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 JSP and the fly likes Unable to access servlet after publishing website 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 » Java » JSP
Reply locked New topic

Unable to access servlet after publishing website

shafidah shafiee

Joined: Mar 04, 2011
Posts: 3
Hi, I need help with JSP and servlet!

I'm trying to deploy a website via an interface called cpanel that is provided by the hosting co.

The directories I have at the moment are:
- public_html
- images
- classes
- lib

My JSP files are in the public_html folder and servlets are in the classes folder.

On my home.jsp i have the following form:
<form name='LoginForm' action='servlet/UserLogin'> ... </form>
(initially I wrote the action attribute as='UserLogin' but it returns an error saying resource is not found. According to e hosting co I need to specify the action attribute as above. Its kinda strange as I dont have a servlet folder to begin with. Anyway it works.)

So upon submission of the form I'll get to the UserLogin servlet. At the end of the servlet, I used the following to return control to my home page:
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/home.jsp");
dispatcher.forward(request, response);

But this will take me to which is non-existent.

Any idea how I can resolve this? My hosting co doesnt seem to know what theyre doing.. unfortunately.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60810

Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please click this link ⇒ CarefullyChooseOneForum ⇐ for more information.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Unable to access servlet after publishing website
Similar Threads
Tomcat unable to find servlet in Shared linux java hosting Server
Url problem
Cannot access servlet after deploying website on cpanel
a problem only on the server
compiling web.xml