The Artima Developer Community
Sponsored Link

Java Answers Forum
where do I place utilies class assicated with a servlet

3 replies on 1 page. Most recent reply: May 29, 2002 2:36 PM by john mattucci

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Yoon-Ling

Posts: 8
Nickname: fan
Registered: Apr, 2002

where do I place utilies class assicated with a servlet Posted: May 20, 2002 9:16 PM
Reply to this message Reply
Advertisement
I tried to invoked an servlet which creates an html page that will present an applet that gather username and password. This servlet will also validate the input and redirect the applet as necessary.

my problems are
1. where do I put the applet class?
2. where do I place utility classes assicated with the applet class.
3. Can they be placed in the same directory with the servlet class? However,I still get error messsge!
4. How to specify the URL for applet in servlet
what I did as follow

out.println("<html>");
out.println("<head>");
out.println("<title>Login</title>");
out.println("<center><h2> Welcome! ~~ Please login</h2>");
out.println("<applet width=500 height = 300");
out.println(" name=\"exelForm\" ");
out.println(" codebase=\""+req.getScheme()+"://" +req.getServerName()+req.getServerPort()+"\"");
out.println(" code=\"com.login.exelForm\">");
out.println("<param name=\"servlet\" value=\" "+ req.getRequestURI()+"\">");
// Get the name of current servlet
out.println("<param name=\"id\" values=\" "+ session.getId()+"\">");
out.println("</applet>");
out.println("</center></body></html>");

I use Tomcat 4.0.3. servlet container.
my web application is place in " webapps/myApp


Thomas SMETS

Posts: 307
Nickname: tsmets
Registered: Apr, 2002

Re: where do I place utilies class assicated with a servlet Posted: May 25, 2002 8:36 AM
Reply to this message Reply
Have you tried :
[b]WEB-INF\lib[/b]
or
[b]WEB-INF\classes[/b]


Depending on the format of the byte code... If I rememeber well

Thomas SMETS,
SCJP2 - Brussels

john mattucci

Posts: 8
Nickname: mats26
Registered: Apr, 2002

Re: where do I place utilies class assicated with a servlet Posted: May 29, 2002 1:39 PM
Reply to this message Reply
first it is easier to place all files in the Root directive that way you do no have to play with the configuration file webapps/Root/ . Place the applet files under webapps/Root and your servlet classes in webapps/Root/web-inf/classes/
If u have any further questions simply ask

john mattucci

Posts: 8
Nickname: mats26
Registered: Apr, 2002

Re: where do I place utilies class assicated with a servlet Posted: May 29, 2002 2:36 PM
Reply to this message Reply
i forgot the url for the applet
depending on the server u are using
http://localhost:8080/AppletClass

Flat View: This topic has 3 replies on 1 page
Topic: Undo Redo in JTable Previous Topic   Next Topic Topic: i need java-help!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use