I am trying to set List as a request parameter in one JSP and then display the same list using EL on other JSP to which I am posting from the first JSP.
The first JSPHere I am setting the request parameter and then submitting to the testList.jsp where I am trying to access the List entries.
testList.jspBut this is getting me this error Please suggest what I need to do differently. TIA
This message was edited 2 times. Last update was at by Giffy Geraldo
I have edited the above post to include those parts that I had just left out. I further found that jar files were missing. So I added jstl-1.2.jar and javax.el.jar.
After this we need javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext. And this is in javaee.jar. When I am trying to add this jar in buildpath - it contains a servlet.class which is creating some conflict.
How to get rid of this.
This message was edited 1 time. Last update was at by Giffy Geraldo
I have edited the above post to include those parts that I had just left out. I further found that jar files were missing. So I added jstl-1.2.jar and javax.el.jar.
Please check THIS link.
Here you get information regarding configuration for JSTL usage.
did the magic. Now only two jars jstl.jar and standard.jar are doing all the work. No need to go for other jars.
One more thing though- in the second jsp where I am trying to access the List is not working. Please tell me how to get it rite. Also how to know which JSP version I am using. Tomcat5.0 is JSP2.0 container that I just saw in the link but any other way to get at that piece.
When I did I shall be able to get the same attribute using get for the name "strList".
But when I am using in the scriptlets on debugging the file the strList here is coming null. Why is this happening. Has it to take with the serialization aspect of the List. May be List can not be set as attribute in the request. Then how else can we access the collections being returned from a servlet in a JSP page.
Very truly pointed out. I added these lines in the first JSP inside the form . This got me the result I was expecting i.e. on the second JSP I am able to access the List elements. Only thing is that while doing cut - the entries are covered by '[' at the start and ']' at the end. I dun kno why?
Thank guys a lot. Without such an active help I would have once again left this exercise incomplete like before.
This message was edited 1 time. Last update was at by Giffy Geraldo
If the list is being generated on the business side then either re-generate it, cache it, keep it static, or something. Or just keep it in the session if it's user-specific, or application context if it's app-wide.