Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

Servlet not running on j2sdkee 1.4

Thread view: 
ajay.partoti@gmail.com - 03 May 2006 10:10 GMT
I am using: j2sdk1.4.1
with j2sdkee1.4(with application server)
The program code is:
html file code:
<html>
 <body>
 <form method="post"
action="http://localhost:8080/check/servlet/GetServlet">

 <input type="text" name="ajay">

 <input type="submit" name="submit">
 </form>
 </body>

</html>
Servlet code:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class GetServlet extends HttpServlet
{
 public void doPost(HttpServletRequest req,HttpServletResponse res)
throws ServletException,IOException
 {
    String s = req.getParameter("ajay");

    PrintWriter out = res.getWriter();
    res.setContentType("text/html");

    out.println("<html><body>" + "HI" + s + "</body></html>");
    out.close();
 }
}

But the above code is not working after proper deployment
It gives servlet path error.
that the resource GetServlet is not found under /check/GetServlet.
I don't know what the problem is?
Please help!
William Brogden - 03 May 2006 16:10 GMT
> I am using: j2sdk1.4.1
> with j2sdkee1.4(with application server)
[quoted text clipped - 13 lines]
> </html>
> Servlet code:

*** Put all servlet related classes in a package
 Not using a package causes all sorts of problems

> import javax.servlet.*;
> import javax.servlet.http.*;
[quoted text clipped - 20 lines]
> I don't know what the problem is?
> Please help!

Signature

Using Opera's revolutionary e-mail client: http://www.opera.com/m2/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.