File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Internal servlet error? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Internal servlet error?" Watch "Internal servlet error?" New topic
Author

Internal servlet error?

darine darine
Ranch Hand

Joined: Mar 08, 2001
Posts: 43
i have the following two simple files and i'm getting internal servlet error,would you please tell me what is wrong?
login.jsp code:
//---------------
<html>
<body bgcolor="#999999">

<form action="/examples/jsp/lloTest/response10.jsp" action="POST" >
<table>
<tr><tr><tr><tr>
<td><td><td><td><td><td><td><b>ID</b></td><td><input type="text" name="id" ></td></td></td></td></td>
</tr></tr></tr></tr>
</table>
</form>
</body>
</html>

//---------------
response10.jsp code
//----------
<% String s= request.getParameter("id"); %>
<html>
<form>
id is <input type="text" name=id value=s ><br>
</form>
</html>

//------------
Andrew Shafer
Ranch Hand

Joined: Jan 19, 2001
Posts: 338

Darine,
What does the error say exactly? When do you get the error?
I think you have a problem with the configuration of the JSP/Servlet engine, since these files will compile and run just fine on my machine.
Also, to comment on your code:

It shouldn't read action="POST". If you want to post the info, the correct attribute is method.

The form in login.jsp has no submit button, so there is no way to send the data to response10.jsp. You need a submit button inside the <form></form> tags.

I also not quite sure why you need all the table rows and cells, you could get more bang for your buck and make your stuff easier to read without it. If you want to make it in a table, you could use cell padding or spacing and less <tr><td></td></tr>.
This first file could be named .html and it would work exactly the same as static content.
In the second .jsp, you get the value id from the form, but the way you are trying to display it won't work.

This will make a text box with the letter s inside.
You need to have <%...%> to access the java variables.
You could change it to:

Or since it isn't going to be submitted to anything, you could drop the textbox and <form></form> tags altogether and do something like this.

None of this will solve the error you are getting, but it should help once you get the server configured.
Also, understanding html is fundamental to 90% of what you are going to do with servlets and 99.99% of .jsp. So getting a better grasp of this technology will be invaluable. There are lots of resources, I suggest webmonkey.com. I'm always using their html cheatsheet. They have tutorials for more html than you want to know.
Happy coding
Andrew
P.S. Give us more information about the server you are trying to run the files on and the specifics of the message you receive.


!_I_Know_Kung_Fu_!
darine darine
Ranch Hand

Joined: Mar 08, 2001
Posts: 43
thanks alot.
that is a big help.
 
Don't get me started about those stupid light bulbs.
 
subject: Internal servlet error?