Search This Blog

Thursday, February 11, 2010

02-11-2010

Got some more of the example Spring MVC project working.  The EL implicit objects are:
  • pageScope
  • requestScope
  • sessionScope
  • applicationScope
  • param
  • paramValues
  • header
  • headerValues
  • cookie
  • initParam
  • pageContext
The pageScope, requestScope, sessionScope and applicationScope are maps of attributes.  The param and paramValues are maps of request parameters.  The header and headerValues are maps of request headers.  The cookie object is a map of cookies.  The initParam object is the map of the context init parameter, not servlet init paramters.  The pageContext is reference to the pageContext object.

Use ${requestScope["parameterName"]} to gain access to the model attributes populated by the controller.

In the irony department, the "shorter" URL is much longer than the original:
http://google.com/ vs http://localhost:8080/6AB016B2DAD7BA49A992BA0213A91CF8.  Bit.ly aliased the same URL down to: http://bit.ly/5kKMN. Doh!

Question: how can I get Spring MVC discriminate between /newURL and /A25xZ?  Answer: one is a POST and the other is a GET.  Yay!

The total number of possibilities with a 5 character string that allows for 0-9, a-z and A-Z is 62 to the 5th power or 916132832.  Could just randomly generate a number within that range and randomly generate a string to map to that string.

No comments:

Post a Comment