This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Internal servlet error?" Watch "Internal servlet error?" New topic

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:
<body bgcolor="#999999">

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

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

Andrew Shafer
Ranch Hand

Joined: Jan 19, 2001
Posts: 338

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 I'm always using their html cheatsheet. They have tutorials for more html than you want to know.
Happy coding
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.

darine darine
Ranch Hand

Joined: Mar 08, 2001
Posts: 43
thanks alot.
that is a big help.
I agree. Here's the link:
subject: Internal servlet error?
It's not a secret anymore!