This is a discussion on "information passed from servlet to JSP" within the Other Programming Languages section. This forum, and the thread "information passed from servlet to JSP are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
information passed from servlet to JSP
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
information passed from servlet to JSP
hello,
sorry for cross-posting, but I first put my thread in the JavaScript forum... so, here is my problem: In my JSP pages I'd like to use a certain info passed by the controller servlet. For instance, in my servlet I have the following:
I also tried:
Could you please explain why I cannot use "myAnimal" in the plain JSP tags??? Thans a lot ! ! ! |
|
|
|
#2
|
|||
|
|||
|
Re: information passed from servlet to JSP
Hey there:
The reason why you can't use myAnimal within the tag is that that object doesn't exist, thus it cannot be resolved. Now you were close whit this line <code><%! Animal jspAnimal = (Animal)request.getAttribute("myAnimal"); %></code> but it should have read: <code> <% Animal jspAnimal = (Animal)request.getAttribute("myAnimal"); %> </code> and then, later on: <code><% for(int i=0; i<jspAnimal.getBody().getLegs().length; i++) { %> ...... <% } %></code> |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with my Servlet - retrieving images from database | Love2Java | Other Programming Languages | 2 | May 27th, 2008 17:15 |
| Passed | Aesir | Webforumz Cafe | 1 | Apr 21st, 2008 19:46 |
| Formatting Passed Value Within ASP Page In Textarea? | Monie | Classic ASP | 15 | Nov 28th, 2007 00:57 |
| [SOLVED] AJAX call to a servlet | pesho318i | JavaScript Forum | 9 | Oct 28th, 2007 13:40 |
| search results with servlet or JSP | twix_ | Other Programming Languages | 1 | Nov 2nd, 2006 22:25 |