View Single Post
  #1 (permalink)  
Old 07-06-2007, 05:07 PM
Unni Unni is offline
Member
 
Join Date: Jul 2007
Posts: 6
Unni is on a distinguished road
Blank result for jsp_servlet in Eclipse
Hello all,

Greetings!!!

I am new to this forum and also to Eclipse..

Have created index.jsp under WebContent in Eclipse. Having firstname and surname text boxes with submit button. Contents look like :

Code:
<form action="GreetingServlet" method="POST"> First Name: <input type="text" name="firstName" size="20"><br> Surname: <input type="text" name="surname" size="20"> <br><br> <input type="submit" value="Submit">
and created GreetingServlet by right clicking ProjectName(HelloServlets) -> New -> Projects -> Servlet
Contents look like:

Code:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); String firstName = request.getParameter("firstName").toString(); String surname = request.getParameter("surname").toString(); }
The problem is that, variables out,firstName,surname are underlined with yellow line in Eclipse's default browser . and when i keep the cursor on that variables then it displays warning message like "The local variable is never read".

SO i guess no contact between jsp and servlet files.. but when i submit the page is directing to http://localhost:8080/HelloServlets/GreetingServlet

but its blank .. Pls Help to execute this program correctly in Eclipse

Thanks in advance

Regards
Unni

Last edited by JavaBean : 07-06-2007 at 09:21 PM. Reason: Codes should be put inside [code] tags!
Reply With Quote
Sponsored Links