Sachin Kadian wrote:if i click on item1 image its item code should go to the servlet and if i click on item2 image its item code should go to the serlvet and so on. how i can do so in html page??
Lakshmi Priya Gopal wrote:Pat Farrell
It is for a class project, that I need to implement using RMI. I am able to understand how it works now, after referring to documentation on the internet.
Thank you for the help guys!
Sudhanshu Mishra wrote:Thanks Pravin,
So may i conclue that the servlet is created after the servlet context has been created,and hence a listener class(ContextLoaderListener) will run before a servlet(DispatcherServlet)?
Thanks.
Piyush Mangal wrote:Hi Pravin, Please find below the sample code. Please note that this is not complete code and is only for your understanding.
JSP
Servlet
Piyush Mangal wrote:
All I am saying is that the above code is incorrect and redundant. You can always set attributes in session scope through your controller and dispatch the request to JSP.
Bear Bibeault wrote:
pravin venkat wrote:if possible will you be able to example code?
If the scoped variable Name is present in request scope, it can be displayed with one of:
${Name}
or
<c:out value="${Name}"/>
depending upon whether HTML-encoding is needed or not (to protect against XSS attacks).
No <c:set> tags are needed.
Piyush Mangal wrote:
All I am saying is that the above code is incorrect and redundant. You can always set attributes in session scope through your controller and dispatch the request to JSP.
Piyush Mangal wrote:
pravin venkat wrote:then, i think these two code abstracts will do the job..
Ideally Servlet should be responsible for setting the attribute in Request or Session scope based on the use case and forward the request to jsp.
JSP should only use EL to display them on screen.