Justin Howard wrote:Hi All,
I have a url "summary.jsp?day=17&month=05&year=2010".
When I use this in summary.jsp it returns null for date, month and year.
I am able to get user without any problem.
I tried using request.getAttribute(). Still no results.
Please help !
see first of all typecasting to string is not required at all in date , month and year since getParameter already returns string.
Secondly getAttribute wont work since you are not setting it any where .
Now can you tell the exact scenario , how you are hitting the URL are you using some servlet in between or directly hitting the URL .
There is no servlet in between. It is a url to the jsp directly.
I have used the apache file upload library in another jsp. But not in the jsp I am talking about.
I do not have enctype="multipart/form-data" in this jsp.
I have given below the two jsps in question.
JSP trying to get the values
In any case:That's going to set an attribute in the *current* request, not a new one.That's a weird id; not really contextually relevant.Is this the code that creates the URL? And it goes directly to the following JSP?
Are you saying they're null because you tried to display them, or because the query isn't returning anything, or some other reason?