This week's giveaway is in the Java/Jakarta EE forum. We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line! See The best approach would be to try to find out what you are doing wrong that makes it difficult.
Dilip Ganesh wrote: Because sending the object to the JSP page and populating the values for the input elements there (using any tag libraries JSTL) i found it difficult.
It should not be difficult. So instead of trying to find some other weird way of doing it -- which is most likely to be even more difficult because it's not natural -- makes no sense at all.
The best approach would be to try to find out what you are doing wrong that makes it difficult.
So what difficulties did you run into?
Thank you so much for your quick reply. In my servlet i am calling web services to fetch the data's. So i will get the data in xml format. For example if i wants to create a new person , in that page i will show the fields like Country , State all this fields values are coming from webservices only. So sending this XML values to JSP and parsing there i found some what difficult. If i am using JAXB also same , i needs to send the JAXBObject to my jsp page and i need to populate values there. I hope it is clear.
you should do all the XML parsing in the servlet, capture the data in normal Java objects, and send those to the JSP. In the JSP, the EL and JSTL can be easily used to consume this data.
The best way to always approach this is to make the servlet do all the hard work of massaging the data into a structure that makes it easy for the JSP to do its job. In other words, keep the JSPs as stupid as possible.