This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Cattle Drive and the fly likes Correct name in action for Servlet-2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Correct name in action for Servlet-2" Watch "Correct name in action for Servlet-2" New topic
Author

Correct name in action for Servlet-2

Daniel Loranz
Ranch Hand

Joined: Jun 17, 2008
Posts: 41
I did not notice this anywhere in the forum - sorry if I'm reposting. Hope this is helps someone else.

For Servlet-2 be sure to notice that the html snippet for creating the form needs to have the action statement changed from ...

action='/servlet/ReverseServlet'

to ...

action='/servlet/Reverse'

Going with the convention from earlier assignments, the assignment title implies that the java class be called Reverse.class (not ReverseServlet.class).
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
I'm not seeing that. Where did you find that (in context)?

I see:

You will need to create a web page that contains the following HTML fragment:
<form method='post' action='/servlet/ReverseServlet'>
Text: <input type='text' name='text' size='50'>


<input type='submit' value='submit'>
</form>

Instructor's solution:
reverse.html: 15 lines
ReverseServlet: 35 lines

Maybe I'm not understanding what you're saying.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Daniel Loranz
Ranch Hand

Joined: Jun 17, 2008
Posts: 41
I just see the discrepancy now.

On http://www.javaranch.com/java-college.jsp
Assignment 2 is listed as Servlets-2 (ReverseServlet) in which case, the action attribute in the form tag is correct.

While on http://www.javaranch.com/drive/servlet/index.jsp
Assignment 2 is listed as Servlets-2 (Reverse), in which case the action attribute needs to be changed.

Thanks.
- Dan
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Thanks, Dan.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Correct name in action for Servlet-2
 
Similar Threads
Issue in web.xml mapping
Call servlet from action class
Interruption in servlets
Life Cycle
Action in struts