Hi all,
Although I have written a few Jsp/Servlet code, I'm still confused about some basics,
General method to use Jsp and Servlet together is:
In Jsp, submit to Servlet, then Servlet get data with Bean, then forward to Jsp.
I think there are several drawbacks using this method.
1. Render all data with Jsp looks rather chaos. e.g.
In Jsp, there is a table whose data is retrieved from DB, the code combined Java
code with HTML is hard to read, why not manipulate the HTML code in Servlet,then in
Jsp:
Set necessary attributes, request.setAttribute("", "");
<jsp:include "/servlets/DisplayDataServet">, very neat. using this method, we can
write some frequently-used servlet, such as :<Page Up, 1, 2, 3 Page Down>
2. After forward to Jsp, the URL still display Servlet url, the most important, in Jsp
file, we must use absolute file path(image), it's very inconvenient for HTML designer.
how to solve it?
3. In jsp file, if I use bean(through usebean tag) always get ClassCastException. I
know the reason, but it still make me unhappy.
I like to use the cutting-edge technology and the most decent method, but in
Jsp/Servlet, I never use any common method, I feel very frustrated.
Any suggestion or clue are highly appreciated.
Pang
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets