• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAVA web server path mapping

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a very simple question.
I put all my .html files in ine JAVA Web Server2.0 /PUBLIC_HTML directory. and I put my servlet java file under /servlets dirctory. In the .html form I add
action="/servlet/dosomething"
and I register this servlet with JAVA web server.
but when I click on submit button, nothing shows up(even no error message!)
Anybody know how to solve this problem?
Thanks for any suggestion!

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i think u didnot catch the exception in the post/get method in the servlet.u catch the exception and in that display the error message using "System.out.println()". now u will be shown the error message on the web server.
another thing could be, u might have used diferent method (get/post) than that u used in the HTML file.make sure that both are same, then try.
i think with these two u will get your answer. all the best
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good morning, Jenny-
Except the suggestions from kiran kumarb, I want to
mention that in UNIX, "/" represents root directory,
but for Java Web Server 2.0, the default servlets directory
should be /absolutePathofJavaWebServerInstallation/servlets
instead of "/servlets".
In order to catch the error messages, you can put
catch (Exception e){
out.println("Exception: "+e.getMessage());
}
after the try{} block or put out.println("label1,2...")
before or after the code you think it has problem. "out" is
defined by "PrintWriter out = response.getWriter();".
Hope it helps you.
 
jenny wang
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your guys' answers.
I moved my java code in JRUN now and everything is fine.
I suspected the JAVA Web Server wasn't functioning very well.
But I will try it again with your suggestion.
Wish you have wonderful days!

Jenny
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jenny,
Visit the site "http://www.sun.com/software/jwebserver/index.html". You might find something of interest w.r.t. JavaWebServer.
.........Anjali......
 
jenny wang
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know Sun won't support Java Web Server anymore after May.
It sounds we have to move to some other server container.
I still think the trial version is not worth try.
It gave me a lot trouble to figure out the container's problem.
Thanks for all guys here when I need help.
Jenny
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic