Spring Framework 3 and session attributes

It throws Exception if controller called first time even though added @SessionAttributes({“form”}) to class. So add following populateForm method will fix this. @SessionAttributes({“form”}) @Controller public class MyController { @ModelAttribute(“form”) public Form populateForm() { return new Form(); // populates form for the first time if its null } @RequestMapping(value=”form”, method=RequestMethod.GET) public ModelAndView viewForm(@ModelAttribute(“form”) Form form) { … Read more

REST – complex applications

The “Filter As Resource” is a perfect tact for this. You can PUT the filter definition to the filter resource, and it can return the filter ID. PUT is idempotent, so even if the filter is already there, you just need to detect that you’ve seen the filter before, so you can return the proper … Read more

Using Express and Node, how to maintain a Session across subdomains/hostheaders

First of all to allow browser to make cross-domain requests you need to set headers on server side. This solution works for normal request as well as AJAX. In your express configure function: Express 4.0: var express = require(‘express’); var session = require(‘express-session’); var cookieParser = require(‘cookie-parser’); var app = express(); app.use(cookieParser()); app.use(session({ secret: ‘yoursecret’, … Read more

Classic ASP: Multiple ASPSESSIONID in cookies

I was able to remove those cookies with Javascript. Just add next script to the end of login page. This will remove all “ASPSESSIONIDXXXXXXX” cookies before user will login to website: <script type=”text/javascript”> //Clear any session cookies (function(){ var cookiesArr = document.cookie.split(“; “); for (var i = 0; i < cookiesArr.length; i++) { var cItem … Read more