You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "McRaven, Brian" <bm...@ncr.com> on 2006/07/11 19:13:49 UTC

Accessing a servlet

Well I'm ticking these newbie questions off.  I have a simple servlet
that I want my form to access.  I compiled the file fine and it is
called JustALittleTest.class.  I placed this file in the
ROOT/WEB-INF/classes folder.  In my JSP I have a form with some submit
buttons.  The action element of the form is set to ="JustALittleTest".
I changed my web.xml file so it now has the following entries:

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>JustAlittleTest.class</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/JustALittleTest.class</url-pattern>
    </servlet-mapping>

I've tried a few changes to the above entries but I haven't gotten it
right yet.  Should the servlet-class value have a .class extension?  Is
my url pattern accessing the correct folder?

Brian

Re: Accessing a servlet

Posted by Martin Gainty <mg...@hotmail.com>.
One more thing
the packagename you use to implement your class needs to be reflected in the classes folder WEB-INF/classes
so for example your class is called barServlet and your package is called foo the location should be
$CATALINA_HOME/webapps/barServlet/WEB-INF/classes/foo/barServlet.class

HTH
Martin--
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: "McRaven, Brian" <bm...@ncr.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Wednesday, July 12, 2006 1:24 PM
Subject: RE: Accessing a servlet


I appreciate everyone's help here.  I've been double checking my syntax.  I created a new project with the old code with a package inserted into the project.  My servlet now delivers a blank screen when it should redirect me to one of my other jsp's.  So I'm getting my servlet recognized but it isn't doing what I want.  I'm going to try a different approach in my code.  The way I have it now I'm using a print statement to output just a <% action tag with appropiate body %>.

Brian

-----Original Message-----
From: Lenandlar Singh [mailto:ls_lugs@yahoo.com] 
Sent: Wednesday, July 12, 2006 1:17 PM
To: Tomcat Users List
Subject: RE: Accessing a servlet



"McRaven, Brian" <bm...@ncr.com> wrote:     I check out on all of that. I'm not sure if this is important but when
I build the servlet there is an error that I get. It underlines my package and says that the package name was not one that it expected.
   
  Make sure your package declaration is correct. e.g. 
   
  package firstservlet;
   
  Your servlet should be in here...
  



-----Original Message-----
From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
Sent: Wednesday, July 12, 2006 12:59 PM
To: Tomcat Users List
Subject: Re: Accessing a servlet

ROOT/WEB-INF/classes/firstpack/JustALittleTest.class

and JustALittleTest.java should have a package declaration of firstpack prior to compilation.


McRaven, Brian wrote:
> Yes, the forms are in the ROOT webapp. The firstpack is in the 
> ROOT/WEB-INF/classes folder. Where should the firstpack go?
> 
> Brian
> 
> -----Original Message-----
> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
> Sent: Wednesday, July 12, 2006 11:30 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> You've deployed this in the ROOT webapp?
> 
> form action should be "/firstpack/JustALittleTest"
> 
> McRaven, Brian wrote:
>> OK so now I have this:
>>
>> action="JustALittleTest/firstpack/JustALittleTest"
>>
>> For a web.xml of file of:
>>
>> 
>> JustALittleTest
>> firstpack.JustALittleTest
>> 
>>
>> 
>> JustALittleTest
>> /firstpack/JustALittleTest
>> 
>>
>> And I get requested resource not found.
>>
>> Brian
>>
>> -----Original Message-----
>> From: Martin Gainty [mailto:mgainty@hotmail.com]
>> Sent: Wednesday, July 12, 2006 11:05 AM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>>
>> check your ./WEB-INF/web.xml
>> 
>> FooServlet
>> FooServlet
>> 
>> 
>> FooServlet
>> /servlet/Foo
>> 
>>
>> reference to invoke is
>> ServletServletNameFromWeb.xml/Url-patternFromActionMapping
>> e.g.
>> FooServlet/servlet/Foo
>>
>> Martin--
>> *********************************************************************
>> This email message and any files transmitted with it contain 
>> confidential information intended only for the person(s) to whom this

>> email message is addressed. If you have received this email message 
>> in error, please notify the sender immediately by telephone or email 
>> and destroy the original message without making a copy. Thank you.
>>
>>
>>
>> ----- Original Message -----
>> From: "McRaven, Brian" 
>> To: "Tomcat Users List" 
>> Sent: Wednesday, July 12, 2006 10:43 AM
>> Subject: RE: Accessing a servlet
>>
>>
>> If the url-pattern should be /firstpack/JustALittleTest then should 
>> the form on the JSP refer to action="firstpack.JustALittleTest" or 
>> action="firstpack/JustALittleTest" ?
>>
>> Brian
>>
>> -----Original Message-----
>> From: McRaven, Brian
>> Sent: Wednesday, July 12, 2006 9:55 AM
>> To: Tomcat Users List; p@pidster.com
>> Subject: RE: Accessing a servlet
>>
>> When I use this entry I get a request resource not found error.
>>
>> 
>> JustALittleTest
>> firstpack.JustALittleTest
>> 
>>
>> 
>> JustALittleTest
>> /firstpack/JustALittleTest
>> 
>>
>> Under the previous error to this one I was using an entry of:
>>
>> 
>> JustALittleTest
>> JustALittleTest
>> 
>>
>> 
>> JustALittleTest
>> /firstpack.JustALittleTest
>> 
>>
>> With the following entry:
>>
>> 
>> JustALittleTest
>> firstpack.JustALittleTest
>> 
>>
>> 
>> JustALittleTest
>> /firstpack.JustALittleTest
>> 
>>
>> I get an error of 'Error allocating a servlet instance'
>>
>> Brian
>>
>> -----Original Message-----
>> From: Pid [mailto:p@pidster.com]
>> Sent: Wednesday, July 12, 2006 9:46 AM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>> 
>> TheServletName
>> package.ThisIsTheClassName
>> 
>> 
>> TheServletName
>> /a/path/to/theservlet
>> 
>>
>> "servlet-name" is used to link the definition to the mapping.
>> defs are grouped together in web.xml, as are mappings.
>>
>> "url-pattern" refers to the path by which you'll access the servlet.
>> it can any unique url on your system, and does not have to reflect
the
> 
>> class name.
>>
>>
>>
>>
>>
>> McRaven, Brian wrote:
>>> I made the servlet part of a package but I'm getting a Servlet not 
>>> Found Exception. The actions I took to make the servlet part of a 
>>> package are the following:
>>>
>>> 1 added package line to java code, recompiled
>>> 2 placed new class file in new subdirectory of WEB-INF/classes
folder
> 
>>> with same name of package
>>> 3 changed entry in web.xml file to reflect package that servlet is
in
> 
>>> for the url-pattern
>>> 4 changed JSP so that the forms action="firstpack.JustALittleTest"
>>>
>>> I've looked at the log files but I'm not sure what to look for.
>>>
>>> Brian
>>>
>>> -----Original Message-----
>>> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
>>> Sent: Wednesday, July 12, 2006 7:49 AM
>>> To: Tomcat Users List
>>> Subject: Re: Accessing a servlet
>>>
>>> I would check in tomcat logs directory for reasons why the servlet
is
> 
>>> not available. One reason could be that classes should be in a
>> package:
>>> http://tomcat.apache.org/faq/classnotfound.html
>>>
>>> HTH,
>>>
>>> Jon
>>>
>>> McRaven, Brian wrote:
>>>> OK I did that and now my system is hanging which I guess could be
an
> 
>>>> error in my code or something with the server. I think it is my 
>>>> code so I'll look that over. Thanks for your help. Sorry for the
>>> confusion.
>>>> Brian
>>>>
>>>> -----Original Message-----
>>>> From: David Smith [mailto:dns4@cornell.edu]
>>>> Sent: Tuesday, July 11, 2006 2:48 PM
>>>> To: Tomcat Users List
>>>> Subject: Re: Accessing a servlet
>>>>
>>>> Did you reload the webapp after making the change? All changes to 
>>>> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will 
>>>> require a reload before they become active in tomcat.
>>>>
>>>> --David
>>>>
>>>> McRaven, Brian wrote:
>>>>
>>>>> I was able to refer to a book I have and so I dropped the .class 
>>>>> extensions altogether. I get an error that requested resource is 
>>>>> not available still. Any suggestions on this? My web.xml file
has
> 
>>>>> this
>>>>> entry:
>>>>>
>>>>> 
>>>>> JustALittleTest
>>>>> JustAlittleTest
>>>>> 
>>>>>
>>>>> 
>>>>> JustALittleTest
>>>>> /JustALittleTest
>>>>> 
>>>>>
>>>>> And my action attribute="JustALittleTest".
>>>>>
>>>>> Brian
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: McRaven, Brian
>>>>> Sent: Tuesday, July 11, 2006 1:14 PM
>>>>> To: users@tomcat.apache.org
>>>>> Subject: Accessing a servlet
>>>>>
>>>>> Well I'm ticking these newbie questions off. I have a simple 
>>>>> servlet that I want my form to access. I compiled the file fine 
>>>>> and it is called JustALittleTest.class. I placed this file in the

>>>>> ROOT/WEB-INF/classes folder. In my JSP I have a form with some 
>>>>> submit buttons. The action element of the form is set to
>>> ="JustALittleTest".
>>>>> I changed my web.xml file so it now has the following entries:
>>>>>
>>>>> 
>>>>> JustALittleTest
>>>>> JustAlittleTest.class
>>>>> 
>>>>>
>>>>> 
>>>>> JustALittleTest
>>>>> /JustALittleTest.class
>>>>> 
>>>>>
>>>>> I've tried a few changes to the above entries but I haven't gotten

>>>>> it right yet. Should the servlet-class value have a .class 
>>>>> extension?
>>>>> Is
>>>>> my url pattern accessing the correct folder?
>>>>>
>>>>> Brian



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org




  
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Accessing a servlet

Posted by "McRaven, Brian" <bm...@ncr.com>.
I appreciate everyone's help here.  I've been double checking my syntax.  I created a new project with the old code with a package inserted into the project.  My servlet now delivers a blank screen when it should redirect me to one of my other jsp's.  So I'm getting my servlet recognized but it isn't doing what I want.  I'm going to try a different approach in my code.  The way I have it now I'm using a print statement to output just a <% action tag with appropiate body %>.

Brian

-----Original Message-----
From: Lenandlar Singh [mailto:ls_lugs@yahoo.com] 
Sent: Wednesday, July 12, 2006 1:17 PM
To: Tomcat Users List
Subject: RE: Accessing a servlet



"McRaven, Brian" <bm...@ncr.com> wrote:     I check out on all of that. I'm not sure if this is important but when
I build the servlet there is an error that I get. It underlines my package and says that the package name was not one that it expected.
   
  Make sure your package declaration is correct. e.g. 
   
  package firstservlet;
   
  Your servlet should be in here...
  



-----Original Message-----
From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
Sent: Wednesday, July 12, 2006 12:59 PM
To: Tomcat Users List
Subject: Re: Accessing a servlet

ROOT/WEB-INF/classes/firstpack/JustALittleTest.class

and JustALittleTest.java should have a package declaration of firstpack prior to compilation.


McRaven, Brian wrote:
> Yes, the forms are in the ROOT webapp. The firstpack is in the 
> ROOT/WEB-INF/classes folder. Where should the firstpack go?
> 
> Brian
> 
> -----Original Message-----
> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
> Sent: Wednesday, July 12, 2006 11:30 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> You've deployed this in the ROOT webapp?
> 
> form action should be "/firstpack/JustALittleTest"
> 
> McRaven, Brian wrote:
>> OK so now I have this:
>>
>> action="JustALittleTest/firstpack/JustALittleTest"
>>
>> For a web.xml of file of:
>>
>> 
>> JustALittleTest
>> firstpack.JustALittleTest
>> 
>>
>> 
>> JustALittleTest
>> /firstpack/JustALittleTest
>> 
>>
>> And I get requested resource not found.
>>
>> Brian
>>
>> -----Original Message-----
>> From: Martin Gainty [mailto:mgainty@hotmail.com]
>> Sent: Wednesday, July 12, 2006 11:05 AM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>>
>> check your ./WEB-INF/web.xml
>> 
>> FooServlet
>> FooServlet
>> 
>> 
>> FooServlet
>> /servlet/Foo
>> 
>>
>> reference to invoke is
>> ServletServletNameFromWeb.xml/Url-patternFromActionMapping
>> e.g.
>> FooServlet/servlet/Foo
>>
>> Martin--
>> *********************************************************************
>> This email message and any files transmitted with it contain 
>> confidential information intended only for the person(s) to whom this

>> email message is addressed. If you have received this email message 
>> in error, please notify the sender immediately by telephone or email 
>> and destroy the original message without making a copy. Thank you.
>>
>>
>>
>> ----- Original Message -----
>> From: "McRaven, Brian" 
>> To: "Tomcat Users List" 
>> Sent: Wednesday, July 12, 2006 10:43 AM
>> Subject: RE: Accessing a servlet
>>
>>
>> If the url-pattern should be /firstpack/JustALittleTest then should 
>> the form on the JSP refer to action="firstpack.JustALittleTest" or 
>> action="firstpack/JustALittleTest" ?
>>
>> Brian
>>
>> -----Original Message-----
>> From: McRaven, Brian
>> Sent: Wednesday, July 12, 2006 9:55 AM
>> To: Tomcat Users List; p@pidster.com
>> Subject: RE: Accessing a servlet
>>
>> When I use this entry I get a request resource not found error.
>>
>> 
>> JustALittleTest
>> firstpack.JustALittleTest
>> 
>>
>> 
>> JustALittleTest
>> /firstpack/JustALittleTest
>> 
>>
>> Under the previous error to this one I was using an entry of:
>>
>> 
>> JustALittleTest
>> JustALittleTest
>> 
>>
>> 
>> JustALittleTest
>> /firstpack.JustALittleTest
>> 
>>
>> With the following entry:
>>
>> 
>> JustALittleTest
>> firstpack.JustALittleTest
>> 
>>
>> 
>> JustALittleTest
>> /firstpack.JustALittleTest
>> 
>>
>> I get an error of 'Error allocating a servlet instance'
>>
>> Brian
>>
>> -----Original Message-----
>> From: Pid [mailto:p@pidster.com]
>> Sent: Wednesday, July 12, 2006 9:46 AM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>> 
>> TheServletName
>> package.ThisIsTheClassName
>> 
>> 
>> TheServletName
>> /a/path/to/theservlet
>> 
>>
>> "servlet-name" is used to link the definition to the mapping.
>> defs are grouped together in web.xml, as are mappings.
>>
>> "url-pattern" refers to the path by which you'll access the servlet.
>> it can any unique url on your system, and does not have to reflect
the
> 
>> class name.
>>
>>
>>
>>
>>
>> McRaven, Brian wrote:
>>> I made the servlet part of a package but I'm getting a Servlet not 
>>> Found Exception. The actions I took to make the servlet part of a 
>>> package are the following:
>>>
>>> 1 added package line to java code, recompiled
>>> 2 placed new class file in new subdirectory of WEB-INF/classes
folder
> 
>>> with same name of package
>>> 3 changed entry in web.xml file to reflect package that servlet is
in
> 
>>> for the url-pattern
>>> 4 changed JSP so that the forms action="firstpack.JustALittleTest"
>>>
>>> I've looked at the log files but I'm not sure what to look for.
>>>
>>> Brian
>>>
>>> -----Original Message-----
>>> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
>>> Sent: Wednesday, July 12, 2006 7:49 AM
>>> To: Tomcat Users List
>>> Subject: Re: Accessing a servlet
>>>
>>> I would check in tomcat logs directory for reasons why the servlet
is
> 
>>> not available. One reason could be that classes should be in a
>> package:
>>> http://tomcat.apache.org/faq/classnotfound.html
>>>
>>> HTH,
>>>
>>> Jon
>>>
>>> McRaven, Brian wrote:
>>>> OK I did that and now my system is hanging which I guess could be
an
> 
>>>> error in my code or something with the server. I think it is my 
>>>> code so I'll look that over. Thanks for your help. Sorry for the
>>> confusion.
>>>> Brian
>>>>
>>>> -----Original Message-----
>>>> From: David Smith [mailto:dns4@cornell.edu]
>>>> Sent: Tuesday, July 11, 2006 2:48 PM
>>>> To: Tomcat Users List
>>>> Subject: Re: Accessing a servlet
>>>>
>>>> Did you reload the webapp after making the change? All changes to 
>>>> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will 
>>>> require a reload before they become active in tomcat.
>>>>
>>>> --David
>>>>
>>>> McRaven, Brian wrote:
>>>>
>>>>> I was able to refer to a book I have and so I dropped the .class 
>>>>> extensions altogether. I get an error that requested resource is 
>>>>> not available still. Any suggestions on this? My web.xml file
has
> 
>>>>> this
>>>>> entry:
>>>>>
>>>>> 
>>>>> JustALittleTest
>>>>> JustAlittleTest
>>>>> 
>>>>>
>>>>> 
>>>>> JustALittleTest
>>>>> /JustALittleTest
>>>>> 
>>>>>
>>>>> And my action attribute="JustALittleTest".
>>>>>
>>>>> Brian
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: McRaven, Brian
>>>>> Sent: Tuesday, July 11, 2006 1:14 PM
>>>>> To: users@tomcat.apache.org
>>>>> Subject: Accessing a servlet
>>>>>
>>>>> Well I'm ticking these newbie questions off. I have a simple 
>>>>> servlet that I want my form to access. I compiled the file fine 
>>>>> and it is called JustALittleTest.class. I placed this file in the

>>>>> ROOT/WEB-INF/classes folder. In my JSP I have a form with some 
>>>>> submit buttons. The action element of the form is set to
>>> ="JustALittleTest".
>>>>> I changed my web.xml file so it now has the following entries:
>>>>>
>>>>> 
>>>>> JustALittleTest
>>>>> JustAlittleTest.class
>>>>> 
>>>>>
>>>>> 
>>>>> JustALittleTest
>>>>> /JustALittleTest.class
>>>>> 
>>>>>
>>>>> I've tried a few changes to the above entries but I haven't gotten

>>>>> it right yet. Should the servlet-class value have a .class 
>>>>> extension?
>>>>> Is
>>>>> my url pattern accessing the correct folder?
>>>>>
>>>>> Brian



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org




 		
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Accessing a servlet

Posted by Lenandlar Singh <ls...@yahoo.com>.

"McRaven, Brian" <bm...@ncr.com> wrote:     I check out on all of that. I'm not sure if this is important but when
I build the servlet there is an error that I get. It underlines my
package and says that the package name was not one that it expected.
   
  Make sure your package declaration is correct. e.g. 
   
  package firstservlet;
   
  Your servlet should be in here...
  



-----Original Message-----
From: Jon Wingfield [mailto:jon.wingfield@mkodo.com] 
Sent: Wednesday, July 12, 2006 12:59 PM
To: Tomcat Users List
Subject: Re: Accessing a servlet

ROOT/WEB-INF/classes/firstpack/JustALittleTest.class

and JustALittleTest.java should have a package declaration of firstpack
prior to compilation.


McRaven, Brian wrote:
> Yes, the forms are in the ROOT webapp. The firstpack is in the
> ROOT/WEB-INF/classes folder. Where should the firstpack go?
> 
> Brian 
> 
> -----Original Message-----
> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com] 
> Sent: Wednesday, July 12, 2006 11:30 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> You've deployed this in the ROOT webapp?
> 
> form action should be "/firstpack/JustALittleTest"
> 
> McRaven, Brian wrote:
>> OK so now I have this:
>>
>> action="JustALittleTest/firstpack/JustALittleTest"
>>
>> For a web.xml of file of:
>>
>> 
>> JustALittleTest
>> firstpack.JustALittleTest
>> 
>>
>> 
>> JustALittleTest
>> /firstpack/JustALittleTest
>> 
>>
>> And I get requested resource not found.
>>
>> Brian
>>
>> -----Original Message-----
>> From: Martin Gainty [mailto:mgainty@hotmail.com]
>> Sent: Wednesday, July 12, 2006 11:05 AM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>>
>> check your ./WEB-INF/web.xml
>> 
>> FooServlet
>> FooServlet
>> 
>> 
>> FooServlet
>> /servlet/Foo
>> 
>>
>> reference to invoke is
>> ServletServletNameFromWeb.xml/Url-patternFromActionMapping
>> e.g.
>> FooServlet/servlet/Foo
>>
>> Martin--
>> *********************************************************************
>> This email message and any files transmitted with it contain 
>> confidential information intended only for the person(s) to whom this

>> email message is addressed. If you have received this email message 
>> in error, please notify the sender immediately by telephone or email 
>> and destroy the original message without making a copy. Thank you.
>>
>>
>>
>> ----- Original Message -----
>> From: "McRaven, Brian" 
>> To: "Tomcat Users List" 
>> Sent: Wednesday, July 12, 2006 10:43 AM
>> Subject: RE: Accessing a servlet
>>
>>
>> If the url-pattern should be /firstpack/JustALittleTest then should 
>> the form on the JSP refer to action="firstpack.JustALittleTest" or 
>> action="firstpack/JustALittleTest" ?
>>
>> Brian
>>
>> -----Original Message-----
>> From: McRaven, Brian
>> Sent: Wednesday, July 12, 2006 9:55 AM
>> To: Tomcat Users List; p@pidster.com
>> Subject: RE: Accessing a servlet
>>
>> When I use this entry I get a request resource not found error.
>>
>> 
>> JustALittleTest
>> firstpack.JustALittleTest
>> 
>>
>> 
>> JustALittleTest
>> /firstpack/JustALittleTest
>> 
>>
>> Under the previous error to this one I was using an entry of:
>>
>> 
>> JustALittleTest
>> JustALittleTest
>> 
>>
>> 
>> JustALittleTest
>> /firstpack.JustALittleTest
>> 
>>
>> With the following entry:
>>
>> 
>> JustALittleTest
>> firstpack.JustALittleTest
>> 
>>
>> 
>> JustALittleTest
>> /firstpack.JustALittleTest
>> 
>>
>> I get an error of 'Error allocating a servlet instance'
>>
>> Brian
>>
>> -----Original Message-----
>> From: Pid [mailto:p@pidster.com]
>> Sent: Wednesday, July 12, 2006 9:46 AM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>> 
>> TheServletName
>> package.ThisIsTheClassName
>> 
>> 
>> TheServletName
>> /a/path/to/theservlet
>> 
>>
>> "servlet-name" is used to link the definition to the mapping.
>> defs are grouped together in web.xml, as are mappings.
>>
>> "url-pattern" refers to the path by which you'll access the servlet.
>> it can any unique url on your system, and does not have to reflect
the
> 
>> class name.
>>
>>
>>
>>
>>
>> McRaven, Brian wrote:
>>> I made the servlet part of a package but I'm getting a Servlet not 
>>> Found Exception. The actions I took to make the servlet part of a 
>>> package are the following:
>>>
>>> 1 added package line to java code, recompiled
>>> 2 placed new class file in new subdirectory of WEB-INF/classes
folder
> 
>>> with same name of package
>>> 3 changed entry in web.xml file to reflect package that servlet is
in
> 
>>> for the url-pattern
>>> 4 changed JSP so that the forms action="firstpack.JustALittleTest"
>>>
>>> I've looked at the log files but I'm not sure what to look for.
>>>
>>> Brian
>>>
>>> -----Original Message-----
>>> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
>>> Sent: Wednesday, July 12, 2006 7:49 AM
>>> To: Tomcat Users List
>>> Subject: Re: Accessing a servlet
>>>
>>> I would check in tomcat logs directory for reasons why the servlet
is
> 
>>> not available. One reason could be that classes should be in a
>> package:
>>> http://tomcat.apache.org/faq/classnotfound.html
>>>
>>> HTH,
>>>
>>> Jon
>>>
>>> McRaven, Brian wrote:
>>>> OK I did that and now my system is hanging which I guess could be
an
> 
>>>> error in my code or something with the server. I think it is my 
>>>> code
>>>> so I'll look that over. Thanks for your help. Sorry for the
>>> confusion.
>>>> Brian
>>>>
>>>> -----Original Message-----
>>>> From: David Smith [mailto:dns4@cornell.edu]
>>>> Sent: Tuesday, July 11, 2006 2:48 PM
>>>> To: Tomcat Users List
>>>> Subject: Re: Accessing a servlet
>>>>
>>>> Did you reload the webapp after making the change? All changes to 
>>>> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will 
>>>> require a reload before they become active in tomcat.
>>>>
>>>> --David
>>>>
>>>> McRaven, Brian wrote:
>>>>
>>>>> I was able to refer to a book I have and so I dropped the .class 
>>>>> extensions altogether. I get an error that requested resource is 
>>>>> not available still. Any suggestions on this? My web.xml file
has
> 
>>>>> this
>>>>> entry:
>>>>>
>>>>> 
>>>>> JustALittleTest
>>>>> JustAlittleTest
>>>>> 
>>>>>
>>>>> 
>>>>> JustALittleTest
>>>>> /JustALittleTest
>>>>> 
>>>>>
>>>>> And my action attribute="JustALittleTest".
>>>>>
>>>>> Brian
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: McRaven, Brian
>>>>> Sent: Tuesday, July 11, 2006 1:14 PM
>>>>> To: users@tomcat.apache.org
>>>>> Subject: Accessing a servlet
>>>>>
>>>>> Well I'm ticking these newbie questions off. I have a simple 
>>>>> servlet that I want my form to access. I compiled the file fine 
>>>>> and it is called JustALittleTest.class. I placed this file in the

>>>>> ROOT/WEB-INF/classes folder. In my JSP I have a form with some 
>>>>> submit buttons. The action element of the form is set to
>>> ="JustALittleTest".
>>>>> I changed my web.xml file so it now has the following entries:
>>>>>
>>>>> 
>>>>> JustALittleTest
>>>>> JustAlittleTest.class
>>>>> 
>>>>>
>>>>> 
>>>>> JustALittleTest
>>>>> /JustALittleTest.class
>>>>> 
>>>>>
>>>>> I've tried a few changes to the above entries but I haven't gotten

>>>>> it right yet. Should the servlet-class value have a .class 
>>>>> extension?
>>>>> Is
>>>>> my url pattern accessing the correct folder?
>>>>>
>>>>> Brian



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org




 		
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.

RE: Accessing a servlet

Posted by "McRaven, Brian" <bm...@ncr.com>.
I check out on all of that.  I'm not sure if this is important but when
I build the servlet there is an error that I get.  It underlines my
package and says that the package name was not one that it expected.
It's not a warning its an error.  I still get a class file out of the
process.  Does this sound like I need to develop the servlet in the
firstpack folder?  

Brian

-----Original Message-----
From: Jon Wingfield [mailto:jon.wingfield@mkodo.com] 
Sent: Wednesday, July 12, 2006 12:59 PM
To: Tomcat Users List
Subject: Re: Accessing a servlet

ROOT/WEB-INF/classes/firstpack/JustALittleTest.class

and JustALittleTest.java should have a package declaration of firstpack
prior to compilation.


McRaven, Brian wrote:
> Yes, the forms are in the ROOT webapp.  The firstpack is in the
> ROOT/WEB-INF/classes folder.  Where should the firstpack go?
> 
> Brian 
> 
> -----Original Message-----
> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com] 
> Sent: Wednesday, July 12, 2006 11:30 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> You've deployed this in the ROOT webapp?
> 
> form action should be "/firstpack/JustALittleTest"
> 
> McRaven, Brian wrote:
>> OK so now I have this:
>>
>> action="JustALittleTest/firstpack/JustALittleTest"
>>
>> For a web.xml of file of:
>>
>>     <servlet>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <servlet-class>firstpack.JustALittleTest</servlet-class>
>>     </servlet>
>>
>>     <servlet-mapping>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <url-pattern>/firstpack/JustALittleTest</url-pattern>
>>     </servlet-mapping>
>>
>> And I get requested resource not found.
>>
>> Brian
>>
>> -----Original Message-----
>> From: Martin Gainty [mailto:mgainty@hotmail.com]
>> Sent: Wednesday, July 12, 2006 11:05 AM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>>
>> check your ./WEB-INF/web.xml
>>  <servlet>
>>       <servlet-name>FooServlet</servlet-name>
>>       <servlet-class>FooServlet</servlet-class>
>> </servlet>
>>  <servlet-mapping>
>>         <servlet-name>FooServlet</servlet-name>
>>         <url-pattern>/servlet/Foo</url-pattern>
>>  </servlet-mapping>
>>
>> reference to invoke is
>> ServletServletNameFromWeb.xml/Url-patternFromActionMapping
>> e.g.
>> FooServlet/servlet/Foo
>>
>> Martin--
>> *********************************************************************
>> This email message and any files transmitted with it contain 
>> confidential information intended only for the person(s) to whom this

>> email message is addressed.  If you have received this email message 
>> in error, please notify the sender immediately by telephone or email 
>> and destroy the original message without making a copy.  Thank you.
>>
>>
>>
>> ----- Original Message -----
>> From: "McRaven, Brian" <bm...@ncr.com>
>> To: "Tomcat Users List" <us...@tomcat.apache.org>
>> Sent: Wednesday, July 12, 2006 10:43 AM
>> Subject: RE: Accessing a servlet
>>
>>
>> If the url-pattern should be /firstpack/JustALittleTest then should 
>> the form on the JSP refer to action="firstpack.JustALittleTest" or 
>> action="firstpack/JustALittleTest" ?
>>
>> Brian
>>
>> -----Original Message-----
>> From: McRaven, Brian
>> Sent: Wednesday, July 12, 2006 9:55 AM
>> To: Tomcat Users List; p@pidster.com
>> Subject: RE: Accessing a servlet
>>
>> When I use this entry I get a request resource not found error.
>>
>>     <servlet>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <servlet-class>firstpack.JustALittleTest</servlet-class>
>>     </servlet>
>>
>>     <servlet-mapping>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <url-pattern>/firstpack/JustALittleTest</url-pattern>
>>     </servlet-mapping>
>>
>> Under the previous error to this one I was using an entry of:
>>
>>     <servlet>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <servlet-class>JustALittleTest</servlet-class>
>>     </servlet>
>>
>>     <servlet-mapping>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <url-pattern>/firstpack.JustALittleTest</url-pattern>
>>     </servlet-mapping>
>>
>> With the following entry:
>>
>>     <servlet>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <servlet-class>firstpack.JustALittleTest</servlet-class>
>>     </servlet>
>>
>>     <servlet-mapping>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <url-pattern>/firstpack.JustALittleTest</url-pattern>
>>     </servlet-mapping>
>>
>> I get an error of 'Error allocating a servlet instance'
>>
>> Brian
>>
>> -----Original Message-----
>> From: Pid [mailto:p@pidster.com]
>> Sent: Wednesday, July 12, 2006 9:46 AM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>> <servlet>
>>    <servlet-name>TheServletName</servlet-name>
>>    <servlet-class>package.ThisIsTheClassName</servlet-class>
>> </servlet>
>> <servlet-mapping>
>>    <servlet-name>TheServletName</servlet-name>
>>    <url-pattern>/a/path/to/theservlet</url-pattern>
>> </servlet-mapping>
>>
>> "servlet-name" is used to link the definition to the mapping.
>> defs are grouped together in web.xml, as are mappings.
>>
>> "url-pattern" refers to the path by which you'll access the servlet.
>> it can any unique url on your system, and does not have to reflect
the
> 
>> class name.
>>
>>
>>
>>
>>
>> McRaven, Brian wrote:
>>> I made the servlet part of a package but I'm getting a Servlet not 
>>> Found Exception.  The actions I took to make the servlet part of a 
>>> package are the following:
>>>
>>> 1 added package line to java code, recompiled
>>> 2 placed new class file in new subdirectory of WEB-INF/classes
folder
> 
>>> with same name of package
>>> 3 changed entry in web.xml file to reflect package that servlet is
in
> 
>>> for the url-pattern
>>> 4 changed JSP so that the forms action="firstpack.JustALittleTest"
>>>
>>> I've looked at the log files but I'm not sure what to look for.
>>>
>>> Brian
>>>
>>> -----Original Message-----
>>> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
>>> Sent: Wednesday, July 12, 2006 7:49 AM
>>> To: Tomcat Users List
>>> Subject: Re: Accessing a servlet
>>>
>>> I would check in tomcat logs directory for reasons why the servlet
is
> 
>>> not available. One reason could be that classes should be in a
>> package:
>>> http://tomcat.apache.org/faq/classnotfound.html
>>>
>>> HTH,
>>>
>>> Jon
>>>
>>> McRaven, Brian wrote:
>>>> OK I did that and now my system is hanging which I guess could be
an
> 
>>>> error in my code or something with the server.  I think it is my 
>>>> code
>>>> so I'll look that over.  Thanks for your help.  Sorry for the
>>> confusion.
>>>> Brian
>>>>
>>>> -----Original Message-----
>>>> From: David Smith [mailto:dns4@cornell.edu]
>>>> Sent: Tuesday, July 11, 2006 2:48 PM
>>>> To: Tomcat Users List
>>>> Subject: Re: Accessing a servlet
>>>>
>>>> Did you reload the webapp after making the change?  All changes to 
>>>> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will 
>>>> require a reload before they become active in tomcat.
>>>>
>>>> --David
>>>>
>>>> McRaven, Brian wrote:
>>>>
>>>>> I was able to refer to a book I have and so I dropped the .class 
>>>>> extensions altogether.  I get an error that requested resource is 
>>>>> not available still.  Any suggestions on this?  My web.xml file
has
> 
>>>>> this
>>>>> entry:
>>>>>
>>>>>    <servlet>
>>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>>       <servlet-class>JustAlittleTest</servlet-class>
>>>>>    </servlet>
>>>>>
>>>>>    <servlet-mapping>
>>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>>       <url-pattern>/JustALittleTest</url-pattern>
>>>>>    </servlet-mapping>
>>>>>
>>>>> And my action attribute="JustALittleTest".
>>>>>
>>>>> Brian
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: McRaven, Brian
>>>>> Sent: Tuesday, July 11, 2006 1:14 PM
>>>>> To: users@tomcat.apache.org
>>>>> Subject: Accessing a servlet
>>>>>
>>>>> Well I'm ticking these newbie questions off.  I have a simple 
>>>>> servlet that I want my form to access.  I compiled the file fine 
>>>>> and it is called JustALittleTest.class.  I placed this file in the

>>>>> ROOT/WEB-INF/classes folder.  In my JSP I have a form with some 
>>>>> submit buttons.  The action element of the form is set to
>>> ="JustALittleTest".
>>>>> I changed my web.xml file so it now has the following entries:
>>>>>
>>>>>    <servlet>
>>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>>       <servlet-class>JustAlittleTest.class</servlet-class>
>>>>>    </servlet>
>>>>>
>>>>>    <servlet-mapping>
>>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>>       <url-pattern>/JustALittleTest.class</url-pattern>
>>>>>    </servlet-mapping>
>>>>>
>>>>> I've tried a few changes to the above entries but I haven't gotten

>>>>> it right yet.  Should the servlet-class value have a .class 
>>>>> extension?
>>>>> Is
>>>>> my url pattern accessing the correct folder?
>>>>>
>>>>> Brian



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Accessing a servlet

Posted by Jon Wingfield <jo...@mkodo.com>.
ROOT/WEB-INF/classes/firstpack/JustALittleTest.class

and JustALittleTest.java should have a package declaration of firstpack 
prior to compilation.


McRaven, Brian wrote:
> Yes, the forms are in the ROOT webapp.  The firstpack is in the
> ROOT/WEB-INF/classes folder.  Where should the firstpack go?
> 
> Brian 
> 
> -----Original Message-----
> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com] 
> Sent: Wednesday, July 12, 2006 11:30 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> You've deployed this in the ROOT webapp?
> 
> form action should be "/firstpack/JustALittleTest"
> 
> McRaven, Brian wrote:
>> OK so now I have this:
>>
>> action="JustALittleTest/firstpack/JustALittleTest"
>>
>> For a web.xml of file of:
>>
>>     <servlet>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <servlet-class>firstpack.JustALittleTest</servlet-class>
>>     </servlet>
>>
>>     <servlet-mapping>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <url-pattern>/firstpack/JustALittleTest</url-pattern>
>>     </servlet-mapping>
>>
>> And I get requested resource not found.
>>
>> Brian
>>
>> -----Original Message-----
>> From: Martin Gainty [mailto:mgainty@hotmail.com]
>> Sent: Wednesday, July 12, 2006 11:05 AM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>>
>> check your ./WEB-INF/web.xml
>>  <servlet>
>>       <servlet-name>FooServlet</servlet-name>
>>       <servlet-class>FooServlet</servlet-class>
>> </servlet>
>>  <servlet-mapping>
>>         <servlet-name>FooServlet</servlet-name>
>>         <url-pattern>/servlet/Foo</url-pattern>
>>  </servlet-mapping>
>>
>> reference to invoke is
>> ServletServletNameFromWeb.xml/Url-patternFromActionMapping
>> e.g.
>> FooServlet/servlet/Foo
>>
>> Martin--
>> *********************************************************************
>> This email message and any files transmitted with it contain 
>> confidential information intended only for the person(s) to whom this 
>> email message is addressed.  If you have received this email message 
>> in error, please notify the sender immediately by telephone or email 
>> and destroy the original message without making a copy.  Thank you.
>>
>>
>>
>> ----- Original Message -----
>> From: "McRaven, Brian" <bm...@ncr.com>
>> To: "Tomcat Users List" <us...@tomcat.apache.org>
>> Sent: Wednesday, July 12, 2006 10:43 AM
>> Subject: RE: Accessing a servlet
>>
>>
>> If the url-pattern should be /firstpack/JustALittleTest then should 
>> the form on the JSP refer to action="firstpack.JustALittleTest" or 
>> action="firstpack/JustALittleTest" ?
>>
>> Brian
>>
>> -----Original Message-----
>> From: McRaven, Brian
>> Sent: Wednesday, July 12, 2006 9:55 AM
>> To: Tomcat Users List; p@pidster.com
>> Subject: RE: Accessing a servlet
>>
>> When I use this entry I get a request resource not found error.
>>
>>     <servlet>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <servlet-class>firstpack.JustALittleTest</servlet-class>
>>     </servlet>
>>
>>     <servlet-mapping>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <url-pattern>/firstpack/JustALittleTest</url-pattern>
>>     </servlet-mapping>
>>
>> Under the previous error to this one I was using an entry of:
>>
>>     <servlet>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <servlet-class>JustALittleTest</servlet-class>
>>     </servlet>
>>
>>     <servlet-mapping>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <url-pattern>/firstpack.JustALittleTest</url-pattern>
>>     </servlet-mapping>
>>
>> With the following entry:
>>
>>     <servlet>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <servlet-class>firstpack.JustALittleTest</servlet-class>
>>     </servlet>
>>
>>     <servlet-mapping>
>>        <servlet-name>JustALittleTest</servlet-name>
>>        <url-pattern>/firstpack.JustALittleTest</url-pattern>
>>     </servlet-mapping>
>>
>> I get an error of 'Error allocating a servlet instance'
>>
>> Brian
>>
>> -----Original Message-----
>> From: Pid [mailto:p@pidster.com]
>> Sent: Wednesday, July 12, 2006 9:46 AM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>> <servlet>
>>    <servlet-name>TheServletName</servlet-name>
>>    <servlet-class>package.ThisIsTheClassName</servlet-class>
>> </servlet>
>> <servlet-mapping>
>>    <servlet-name>TheServletName</servlet-name>
>>    <url-pattern>/a/path/to/theservlet</url-pattern>
>> </servlet-mapping>
>>
>> "servlet-name" is used to link the definition to the mapping.
>> defs are grouped together in web.xml, as are mappings.
>>
>> "url-pattern" refers to the path by which you'll access the servlet.
>> it can any unique url on your system, and does not have to reflect the
> 
>> class name.
>>
>>
>>
>>
>>
>> McRaven, Brian wrote:
>>> I made the servlet part of a package but I'm getting a Servlet not 
>>> Found Exception.  The actions I took to make the servlet part of a 
>>> package are the following:
>>>
>>> 1 added package line to java code, recompiled
>>> 2 placed new class file in new subdirectory of WEB-INF/classes folder
> 
>>> with same name of package
>>> 3 changed entry in web.xml file to reflect package that servlet is in
> 
>>> for the url-pattern
>>> 4 changed JSP so that the forms action="firstpack.JustALittleTest"
>>>
>>> I've looked at the log files but I'm not sure what to look for.
>>>
>>> Brian
>>>
>>> -----Original Message-----
>>> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
>>> Sent: Wednesday, July 12, 2006 7:49 AM
>>> To: Tomcat Users List
>>> Subject: Re: Accessing a servlet
>>>
>>> I would check in tomcat logs directory for reasons why the servlet is
> 
>>> not available. One reason could be that classes should be in a
>> package:
>>> http://tomcat.apache.org/faq/classnotfound.html
>>>
>>> HTH,
>>>
>>> Jon
>>>
>>> McRaven, Brian wrote:
>>>> OK I did that and now my system is hanging which I guess could be an
> 
>>>> error in my code or something with the server.  I think it is my 
>>>> code
>>>> so I'll look that over.  Thanks for your help.  Sorry for the
>>> confusion.
>>>> Brian
>>>>
>>>> -----Original Message-----
>>>> From: David Smith [mailto:dns4@cornell.edu]
>>>> Sent: Tuesday, July 11, 2006 2:48 PM
>>>> To: Tomcat Users List
>>>> Subject: Re: Accessing a servlet
>>>>
>>>> Did you reload the webapp after making the change?  All changes to 
>>>> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will 
>>>> require a reload before they become active in tomcat.
>>>>
>>>> --David
>>>>
>>>> McRaven, Brian wrote:
>>>>
>>>>> I was able to refer to a book I have and so I dropped the .class 
>>>>> extensions altogether.  I get an error that requested resource is 
>>>>> not available still.  Any suggestions on this?  My web.xml file has
> 
>>>>> this
>>>>> entry:
>>>>>
>>>>>    <servlet>
>>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>>       <servlet-class>JustAlittleTest</servlet-class>
>>>>>    </servlet>
>>>>>
>>>>>    <servlet-mapping>
>>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>>       <url-pattern>/JustALittleTest</url-pattern>
>>>>>    </servlet-mapping>
>>>>>
>>>>> And my action attribute="JustALittleTest".
>>>>>
>>>>> Brian
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: McRaven, Brian
>>>>> Sent: Tuesday, July 11, 2006 1:14 PM
>>>>> To: users@tomcat.apache.org
>>>>> Subject: Accessing a servlet
>>>>>
>>>>> Well I'm ticking these newbie questions off.  I have a simple 
>>>>> servlet that I want my form to access.  I compiled the file fine 
>>>>> and it is called JustALittleTest.class.  I placed this file in the 
>>>>> ROOT/WEB-INF/classes folder.  In my JSP I have a form with some 
>>>>> submit buttons.  The action element of the form is set to
>>> ="JustALittleTest".
>>>>> I changed my web.xml file so it now has the following entries:
>>>>>
>>>>>    <servlet>
>>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>>       <servlet-class>JustAlittleTest.class</servlet-class>
>>>>>    </servlet>
>>>>>
>>>>>    <servlet-mapping>
>>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>>       <url-pattern>/JustALittleTest.class</url-pattern>
>>>>>    </servlet-mapping>
>>>>>
>>>>> I've tried a few changes to the above entries but I haven't gotten 
>>>>> it right yet.  Should the servlet-class value have a .class 
>>>>> extension?
>>>>> Is
>>>>> my url pattern accessing the correct folder?
>>>>>
>>>>> Brian



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Accessing a servlet

Posted by "McRaven, Brian" <bm...@ncr.com>.
Yes, the forms are in the ROOT webapp.  The firstpack is in the
ROOT/WEB-INF/classes folder.  Where should the firstpack go?

Brian 

-----Original Message-----
From: Jon Wingfield [mailto:jon.wingfield@mkodo.com] 
Sent: Wednesday, July 12, 2006 11:30 AM
To: Tomcat Users List
Subject: Re: Accessing a servlet

You've deployed this in the ROOT webapp?

form action should be "/firstpack/JustALittleTest"

McRaven, Brian wrote:
> OK so now I have this:
> 
> action="JustALittleTest/firstpack/JustALittleTest"
> 
> For a web.xml of file of:
> 
>     <servlet>
>        <servlet-name>JustALittleTest</servlet-name>
>        <servlet-class>firstpack.JustALittleTest</servlet-class>
>     </servlet>
> 
>     <servlet-mapping>
>        <servlet-name>JustALittleTest</servlet-name>
>        <url-pattern>/firstpack/JustALittleTest</url-pattern>
>     </servlet-mapping>
> 
> And I get requested resource not found.
> 
> Brian
> 
> -----Original Message-----
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Sent: Wednesday, July 12, 2006 11:05 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> 
> check your ./WEB-INF/web.xml
>  <servlet>
>       <servlet-name>FooServlet</servlet-name>
>       <servlet-class>FooServlet</servlet-class>
> </servlet>
>  <servlet-mapping>
>         <servlet-name>FooServlet</servlet-name>
>         <url-pattern>/servlet/Foo</url-pattern>
>  </servlet-mapping>
> 
> reference to invoke is
> ServletServletNameFromWeb.xml/Url-patternFromActionMapping
> e.g.
> FooServlet/servlet/Foo
> 
> Martin--
> *********************************************************************
> This email message and any files transmitted with it contain 
> confidential information intended only for the person(s) to whom this 
> email message is addressed.  If you have received this email message 
> in error, please notify the sender immediately by telephone or email 
> and destroy the original message without making a copy.  Thank you.
> 
> 
> 
> ----- Original Message -----
> From: "McRaven, Brian" <bm...@ncr.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Wednesday, July 12, 2006 10:43 AM
> Subject: RE: Accessing a servlet
> 
> 
> If the url-pattern should be /firstpack/JustALittleTest then should 
> the form on the JSP refer to action="firstpack.JustALittleTest" or 
> action="firstpack/JustALittleTest" ?
> 
> Brian
> 
> -----Original Message-----
> From: McRaven, Brian
> Sent: Wednesday, July 12, 2006 9:55 AM
> To: Tomcat Users List; p@pidster.com
> Subject: RE: Accessing a servlet
> 
> When I use this entry I get a request resource not found error.
> 
>     <servlet>
>        <servlet-name>JustALittleTest</servlet-name>
>        <servlet-class>firstpack.JustALittleTest</servlet-class>
>     </servlet>
> 
>     <servlet-mapping>
>        <servlet-name>JustALittleTest</servlet-name>
>        <url-pattern>/firstpack/JustALittleTest</url-pattern>
>     </servlet-mapping>
> 
> Under the previous error to this one I was using an entry of:
> 
>     <servlet>
>        <servlet-name>JustALittleTest</servlet-name>
>        <servlet-class>JustALittleTest</servlet-class>
>     </servlet>
> 
>     <servlet-mapping>
>        <servlet-name>JustALittleTest</servlet-name>
>        <url-pattern>/firstpack.JustALittleTest</url-pattern>
>     </servlet-mapping>
> 
> With the following entry:
> 
>     <servlet>
>        <servlet-name>JustALittleTest</servlet-name>
>        <servlet-class>firstpack.JustALittleTest</servlet-class>
>     </servlet>
> 
>     <servlet-mapping>
>        <servlet-name>JustALittleTest</servlet-name>
>        <url-pattern>/firstpack.JustALittleTest</url-pattern>
>     </servlet-mapping>
> 
> I get an error of 'Error allocating a servlet instance'
> 
> Brian
> 
> -----Original Message-----
> From: Pid [mailto:p@pidster.com]
> Sent: Wednesday, July 12, 2006 9:46 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> <servlet>
>    <servlet-name>TheServletName</servlet-name>
>    <servlet-class>package.ThisIsTheClassName</servlet-class>
> </servlet>
> <servlet-mapping>
>    <servlet-name>TheServletName</servlet-name>
>    <url-pattern>/a/path/to/theservlet</url-pattern>
> </servlet-mapping>
> 
> "servlet-name" is used to link the definition to the mapping.
> defs are grouped together in web.xml, as are mappings.
> 
> "url-pattern" refers to the path by which you'll access the servlet.
> it can any unique url on your system, and does not have to reflect the

> class name.
> 
> 
> 
> 
> 
> McRaven, Brian wrote:
>> I made the servlet part of a package but I'm getting a Servlet not 
>> Found Exception.  The actions I took to make the servlet part of a 
>> package are the following:
>>
>> 1 added package line to java code, recompiled
>> 2 placed new class file in new subdirectory of WEB-INF/classes folder

>> with same name of package
>> 3 changed entry in web.xml file to reflect package that servlet is in

>> for the url-pattern
>> 4 changed JSP so that the forms action="firstpack.JustALittleTest"
>>
>> I've looked at the log files but I'm not sure what to look for.
>>
>> Brian
>>
>> -----Original Message-----
>> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
>> Sent: Wednesday, July 12, 2006 7:49 AM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>> I would check in tomcat logs directory for reasons why the servlet is

>> not available. One reason could be that classes should be in a
> package:
>> http://tomcat.apache.org/faq/classnotfound.html
>>
>> HTH,
>>
>> Jon
>>
>> McRaven, Brian wrote:
>>> OK I did that and now my system is hanging which I guess could be an

>>> error in my code or something with the server.  I think it is my 
>>> code
> 
>>> so I'll look that over.  Thanks for your help.  Sorry for the
>> confusion.
>>> Brian
>>>
>>> -----Original Message-----
>>> From: David Smith [mailto:dns4@cornell.edu]
>>> Sent: Tuesday, July 11, 2006 2:48 PM
>>> To: Tomcat Users List
>>> Subject: Re: Accessing a servlet
>>>
>>> Did you reload the webapp after making the change?  All changes to 
>>> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will 
>>> require a reload before they become active in tomcat.
>>>
>>> --David
>>>
>>> McRaven, Brian wrote:
>>>
>>>> I was able to refer to a book I have and so I dropped the .class 
>>>> extensions altogether.  I get an error that requested resource is 
>>>> not available still.  Any suggestions on this?  My web.xml file has

>>>> this
>>>> entry:
>>>>
>>>>    <servlet>
>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>       <servlet-class>JustAlittleTest</servlet-class>
>>>>    </servlet>
>>>>
>>>>    <servlet-mapping>
>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>       <url-pattern>/JustALittleTest</url-pattern>
>>>>    </servlet-mapping>
>>>>
>>>> And my action attribute="JustALittleTest".
>>>>
>>>> Brian
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: McRaven, Brian
>>>> Sent: Tuesday, July 11, 2006 1:14 PM
>>>> To: users@tomcat.apache.org
>>>> Subject: Accessing a servlet
>>>>
>>>> Well I'm ticking these newbie questions off.  I have a simple 
>>>> servlet that I want my form to access.  I compiled the file fine 
>>>> and it is called JustALittleTest.class.  I placed this file in the 
>>>> ROOT/WEB-INF/classes folder.  In my JSP I have a form with some 
>>>> submit buttons.  The action element of the form is set to
>> ="JustALittleTest".
>>>> I changed my web.xml file so it now has the following entries:
>>>>
>>>>    <servlet>
>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>       <servlet-class>JustAlittleTest.class</servlet-class>
>>>>    </servlet>
>>>>
>>>>    <servlet-mapping>
>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>       <url-pattern>/JustALittleTest.class</url-pattern>
>>>>    </servlet-mapping>
>>>>
>>>> I've tried a few changes to the above entries but I haven't gotten 
>>>> it right yet.  Should the servlet-class value have a .class 
>>>> extension?
> 
>>>> Is
>>>> my url pattern accessing the correct folder?
>>>>
>>>> Brian
>>>>
>>
>>



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Accessing a servlet

Posted by Jon Wingfield <jo...@mkodo.com>.
You've deployed this in the ROOT webapp?

form action should be "/firstpack/JustALittleTest"

McRaven, Brian wrote:
> OK so now I have this:
> 
> action="JustALittleTest/firstpack/JustALittleTest"
> 
> For a web.xml of file of:
> 
>     <servlet>
>        <servlet-name>JustALittleTest</servlet-name>
>        <servlet-class>firstpack.JustALittleTest</servlet-class>
>     </servlet>
> 
>     <servlet-mapping>
>        <servlet-name>JustALittleTest</servlet-name>
>        <url-pattern>/firstpack/JustALittleTest</url-pattern>
>     </servlet-mapping>
> 
> And I get requested resource not found.
> 
> Brian
> 
> -----Original Message-----
> From: Martin Gainty [mailto:mgainty@hotmail.com] 
> Sent: Wednesday, July 12, 2006 11:05 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> 
> check your ./WEB-INF/web.xml
>  <servlet>
>       <servlet-name>FooServlet</servlet-name>
>       <servlet-class>FooServlet</servlet-class>
> </servlet>
>  <servlet-mapping>
>         <servlet-name>FooServlet</servlet-name>
>         <url-pattern>/servlet/Foo</url-pattern>
>  </servlet-mapping>
> 
> reference to invoke is
> ServletServletNameFromWeb.xml/Url-patternFromActionMapping
> e.g.
> FooServlet/servlet/Foo
> 
> Martin--
> *********************************************************************
> This email message and any files transmitted with it contain
> confidential information intended only for the person(s) to whom this
> email message is addressed.  If you have received this email message in
> error, please notify the sender immediately by telephone or email and
> destroy the original message without making a copy.  Thank you.
> 
> 
> 
> ----- Original Message -----
> From: "McRaven, Brian" <bm...@ncr.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Wednesday, July 12, 2006 10:43 AM
> Subject: RE: Accessing a servlet
> 
> 
> If the url-pattern should be /firstpack/JustALittleTest then should the
> form on the JSP refer to action="firstpack.JustALittleTest" or
> action="firstpack/JustALittleTest" ? 
> 
> Brian 
> 
> -----Original Message-----
> From: McRaven, Brian 
> Sent: Wednesday, July 12, 2006 9:55 AM
> To: Tomcat Users List; p@pidster.com
> Subject: RE: Accessing a servlet
> 
> When I use this entry I get a request resource not found error.
> 
>     <servlet>
>        <servlet-name>JustALittleTest</servlet-name>
>        <servlet-class>firstpack.JustALittleTest</servlet-class>
>     </servlet>
> 
>     <servlet-mapping>
>        <servlet-name>JustALittleTest</servlet-name>
>        <url-pattern>/firstpack/JustALittleTest</url-pattern>
>     </servlet-mapping>
> 
> Under the previous error to this one I was using an entry of:
> 
>     <servlet>
>        <servlet-name>JustALittleTest</servlet-name>
>        <servlet-class>JustALittleTest</servlet-class>
>     </servlet>
> 
>     <servlet-mapping>
>        <servlet-name>JustALittleTest</servlet-name>
>        <url-pattern>/firstpack.JustALittleTest</url-pattern>
>     </servlet-mapping>
> 
> With the following entry:
> 
>     <servlet>
>        <servlet-name>JustALittleTest</servlet-name>
>        <servlet-class>firstpack.JustALittleTest</servlet-class>
>     </servlet>
> 
>     <servlet-mapping>
>        <servlet-name>JustALittleTest</servlet-name>
>        <url-pattern>/firstpack.JustALittleTest</url-pattern>
>     </servlet-mapping>
> 
> I get an error of 'Error allocating a servlet instance'
> 
> Brian
> 
> -----Original Message-----
> From: Pid [mailto:p@pidster.com]
> Sent: Wednesday, July 12, 2006 9:46 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> <servlet>
>    <servlet-name>TheServletName</servlet-name>
>    <servlet-class>package.ThisIsTheClassName</servlet-class>
> </servlet>
> <servlet-mapping>
>    <servlet-name>TheServletName</servlet-name>
>    <url-pattern>/a/path/to/theservlet</url-pattern>
> </servlet-mapping>
> 
> "servlet-name" is used to link the definition to the mapping.
> defs are grouped together in web.xml, as are mappings.
> 
> "url-pattern" refers to the path by which you'll access the servlet.
> it can any unique url on your system, and does not have to reflect the
> class name.
> 
> 
> 
> 
> 
> McRaven, Brian wrote:
>> I made the servlet part of a package but I'm getting a Servlet not 
>> Found Exception.  The actions I took to make the servlet part of a 
>> package are the following:
>>
>> 1 added package line to java code, recompiled
>> 2 placed new class file in new subdirectory of WEB-INF/classes folder 
>> with same name of package
>> 3 changed entry in web.xml file to reflect package that servlet is in 
>> for the url-pattern
>> 4 changed JSP so that the forms action="firstpack.JustALittleTest"
>>
>> I've looked at the log files but I'm not sure what to look for.
>>
>> Brian
>>
>> -----Original Message-----
>> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
>> Sent: Wednesday, July 12, 2006 7:49 AM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>> I would check in tomcat logs directory for reasons why the servlet is 
>> not available. One reason could be that classes should be in a
> package:
>> http://tomcat.apache.org/faq/classnotfound.html
>>
>> HTH,
>>
>> Jon
>>
>> McRaven, Brian wrote:
>>> OK I did that and now my system is hanging which I guess could be an 
>>> error in my code or something with the server.  I think it is my code
> 
>>> so I'll look that over.  Thanks for your help.  Sorry for the
>> confusion.
>>> Brian
>>>
>>> -----Original Message-----
>>> From: David Smith [mailto:dns4@cornell.edu]
>>> Sent: Tuesday, July 11, 2006 2:48 PM
>>> To: Tomcat Users List
>>> Subject: Re: Accessing a servlet
>>>
>>> Did you reload the webapp after making the change?  All changes to 
>>> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will 
>>> require a reload before they become active in tomcat.
>>>
>>> --David
>>>
>>> McRaven, Brian wrote:
>>>
>>>> I was able to refer to a book I have and so I dropped the .class 
>>>> extensions altogether.  I get an error that requested resource is 
>>>> not
>>>> available still.  Any suggestions on this?  My web.xml file has this
>>>> entry:
>>>>
>>>>    <servlet>
>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>       <servlet-class>JustAlittleTest</servlet-class>
>>>>    </servlet>
>>>>
>>>>    <servlet-mapping>
>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>       <url-pattern>/JustALittleTest</url-pattern>
>>>>    </servlet-mapping>
>>>>
>>>> And my action attribute="JustALittleTest".
>>>>
>>>> Brian
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: McRaven, Brian
>>>> Sent: Tuesday, July 11, 2006 1:14 PM
>>>> To: users@tomcat.apache.org
>>>> Subject: Accessing a servlet
>>>>
>>>> Well I'm ticking these newbie questions off.  I have a simple 
>>>> servlet
>>>> that I want my form to access.  I compiled the file fine and it is 
>>>> called JustALittleTest.class.  I placed this file in the 
>>>> ROOT/WEB-INF/classes folder.  In my JSP I have a form with some 
>>>> submit buttons.  The action element of the form is set to
>> ="JustALittleTest".
>>>> I changed my web.xml file so it now has the following entries:
>>>>
>>>>    <servlet>
>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>       <servlet-class>JustAlittleTest.class</servlet-class>
>>>>    </servlet>
>>>>
>>>>    <servlet-mapping>
>>>>       <servlet-name>JustALittleTest</servlet-name>
>>>>       <url-pattern>/JustALittleTest.class</url-pattern>
>>>>    </servlet-mapping>
>>>>
>>>> I've tried a few changes to the above entries but I haven't gotten 
>>>> it
>>>> right yet.  Should the servlet-class value have a .class extension?
> 
>>>> Is
>>>> my url pattern accessing the correct folder?
>>>>
>>>> Brian
>>>>
>>
>>



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Accessing a servlet

Posted by "McRaven, Brian" <bm...@ncr.com>.
OK so now I have this:

action="JustALittleTest/firstpack/JustALittleTest"

For a web.xml of file of:

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>firstpack.JustALittleTest</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/firstpack/JustALittleTest</url-pattern>
    </servlet-mapping>

And I get requested resource not found.

Brian

-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Wednesday, July 12, 2006 11:05 AM
To: Tomcat Users List
Subject: Re: Accessing a servlet


check your ./WEB-INF/web.xml
 <servlet>
      <servlet-name>FooServlet</servlet-name>
      <servlet-class>FooServlet</servlet-class>
</servlet>
 <servlet-mapping>
        <servlet-name>FooServlet</servlet-name>
        <url-pattern>/servlet/Foo</url-pattern>
 </servlet-mapping>

reference to invoke is
ServletServletNameFromWeb.xml/Url-patternFromActionMapping
e.g.
FooServlet/servlet/Foo

Martin--
*********************************************************************
This email message and any files transmitted with it contain
confidential information intended only for the person(s) to whom this
email message is addressed.  If you have received this email message in
error, please notify the sender immediately by telephone or email and
destroy the original message without making a copy.  Thank you.



----- Original Message -----
From: "McRaven, Brian" <bm...@ncr.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Wednesday, July 12, 2006 10:43 AM
Subject: RE: Accessing a servlet


If the url-pattern should be /firstpack/JustALittleTest then should the
form on the JSP refer to action="firstpack.JustALittleTest" or
action="firstpack/JustALittleTest" ? 

Brian 

-----Original Message-----
From: McRaven, Brian 
Sent: Wednesday, July 12, 2006 9:55 AM
To: Tomcat Users List; p@pidster.com
Subject: RE: Accessing a servlet

When I use this entry I get a request resource not found error.

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>firstpack.JustALittleTest</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/firstpack/JustALittleTest</url-pattern>
    </servlet-mapping>

Under the previous error to this one I was using an entry of:

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>JustALittleTest</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/firstpack.JustALittleTest</url-pattern>
    </servlet-mapping>

With the following entry:

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>firstpack.JustALittleTest</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/firstpack.JustALittleTest</url-pattern>
    </servlet-mapping>

I get an error of 'Error allocating a servlet instance'

Brian

-----Original Message-----
From: Pid [mailto:p@pidster.com]
Sent: Wednesday, July 12, 2006 9:46 AM
To: Tomcat Users List
Subject: Re: Accessing a servlet

<servlet>
   <servlet-name>TheServletName</servlet-name>
   <servlet-class>package.ThisIsTheClassName</servlet-class>
</servlet>
<servlet-mapping>
   <servlet-name>TheServletName</servlet-name>
   <url-pattern>/a/path/to/theservlet</url-pattern>
</servlet-mapping>

"servlet-name" is used to link the definition to the mapping.
defs are grouped together in web.xml, as are mappings.

"url-pattern" refers to the path by which you'll access the servlet.
it can any unique url on your system, and does not have to reflect the
class name.





McRaven, Brian wrote:
> I made the servlet part of a package but I'm getting a Servlet not 
> Found Exception.  The actions I took to make the servlet part of a 
> package are the following:
> 
> 1 added package line to java code, recompiled
> 2 placed new class file in new subdirectory of WEB-INF/classes folder 
> with same name of package
> 3 changed entry in web.xml file to reflect package that servlet is in 
> for the url-pattern
> 4 changed JSP so that the forms action="firstpack.JustALittleTest"
> 
> I've looked at the log files but I'm not sure what to look for.
> 
> Brian
> 
> -----Original Message-----
> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
> Sent: Wednesday, July 12, 2006 7:49 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> I would check in tomcat logs directory for reasons why the servlet is 
> not available. One reason could be that classes should be in a
package:
> 
> http://tomcat.apache.org/faq/classnotfound.html
> 
> HTH,
> 
> Jon
> 
> McRaven, Brian wrote:
>> OK I did that and now my system is hanging which I guess could be an 
>> error in my code or something with the server.  I think it is my code

>> so I'll look that over.  Thanks for your help.  Sorry for the
> confusion.
>> Brian
>>
>> -----Original Message-----
>> From: David Smith [mailto:dns4@cornell.edu]
>> Sent: Tuesday, July 11, 2006 2:48 PM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>> Did you reload the webapp after making the change?  All changes to 
>> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will 
>> require a reload before they become active in tomcat.
>>
>> --David
>>
>> McRaven, Brian wrote:
>>
>>> I was able to refer to a book I have and so I dropped the .class 
>>> extensions altogether.  I get an error that requested resource is 
>>> not
> 
>>> available still.  Any suggestions on this?  My web.xml file has this
>>> entry:
>>>
>>>    <servlet>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <servlet-class>JustAlittleTest</servlet-class>
>>>    </servlet>
>>>
>>>    <servlet-mapping>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <url-pattern>/JustALittleTest</url-pattern>
>>>    </servlet-mapping>
>>>
>>> And my action attribute="JustALittleTest".
>>>
>>> Brian
>>>
>>>
>>> -----Original Message-----
>>> From: McRaven, Brian
>>> Sent: Tuesday, July 11, 2006 1:14 PM
>>> To: users@tomcat.apache.org
>>> Subject: Accessing a servlet
>>>
>>> Well I'm ticking these newbie questions off.  I have a simple 
>>> servlet
> 
>>> that I want my form to access.  I compiled the file fine and it is 
>>> called JustALittleTest.class.  I placed this file in the 
>>> ROOT/WEB-INF/classes folder.  In my JSP I have a form with some 
>>> submit buttons.  The action element of the form is set to
> ="JustALittleTest".
>>> I changed my web.xml file so it now has the following entries:
>>>
>>>    <servlet>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <servlet-class>JustAlittleTest.class</servlet-class>
>>>    </servlet>
>>>
>>>    <servlet-mapping>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <url-pattern>/JustALittleTest.class</url-pattern>
>>>    </servlet-mapping>
>>>
>>> I've tried a few changes to the above entries but I haven't gotten 
>>> it
> 
>>> right yet.  Should the servlet-class value have a .class extension?

>>> Is
>>> my url pattern accessing the correct folder?
>>>
>>> Brian
>>>
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
> e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
> e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Accessing a servlet

Posted by Martin Gainty <mg...@hotmail.com>.
check your ./WEB-INF/web.xml 
 <servlet>
      <servlet-name>FooServlet</servlet-name>
      <servlet-class>FooServlet</servlet-class>
</servlet>
 <servlet-mapping>
        <servlet-name>FooServlet</servlet-name>
        <url-pattern>/servlet/Foo</url-pattern>
 </servlet-mapping>

reference to invoke is
ServletServletNameFromWeb.xml/Url-patternFromActionMapping
e.g.
FooServlet/servlet/Foo

Martin--
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: "McRaven, Brian" <bm...@ncr.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Wednesday, July 12, 2006 10:43 AM
Subject: RE: Accessing a servlet


If the url-pattern should be /firstpack/JustALittleTest then should the
form on the JSP refer to action="firstpack.JustALittleTest" or
action="firstpack/JustALittleTest" ? 

Brian 

-----Original Message-----
From: McRaven, Brian 
Sent: Wednesday, July 12, 2006 9:55 AM
To: Tomcat Users List; p@pidster.com
Subject: RE: Accessing a servlet

When I use this entry I get a request resource not found error.

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>firstpack.JustALittleTest</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/firstpack/JustALittleTest</url-pattern>
    </servlet-mapping>

Under the previous error to this one I was using an entry of:

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>JustALittleTest</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/firstpack.JustALittleTest</url-pattern>
    </servlet-mapping>

With the following entry:

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>firstpack.JustALittleTest</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/firstpack.JustALittleTest</url-pattern>
    </servlet-mapping>

I get an error of 'Error allocating a servlet instance'

Brian

-----Original Message-----
From: Pid [mailto:p@pidster.com]
Sent: Wednesday, July 12, 2006 9:46 AM
To: Tomcat Users List
Subject: Re: Accessing a servlet

<servlet>
   <servlet-name>TheServletName</servlet-name>
   <servlet-class>package.ThisIsTheClassName</servlet-class>
</servlet>
<servlet-mapping>
   <servlet-name>TheServletName</servlet-name>
   <url-pattern>/a/path/to/theservlet</url-pattern>
</servlet-mapping>

"servlet-name" is used to link the definition to the mapping.
defs are grouped together in web.xml, as are mappings.

"url-pattern" refers to the path by which you'll access the servlet.
it can any unique url on your system, and does not have to reflect the
class name.





McRaven, Brian wrote:
> I made the servlet part of a package but I'm getting a Servlet not 
> Found Exception.  The actions I took to make the servlet part of a 
> package are the following:
> 
> 1 added package line to java code, recompiled
> 2 placed new class file in new subdirectory of WEB-INF/classes folder 
> with same name of package
> 3 changed entry in web.xml file to reflect package that servlet is in 
> for the url-pattern
> 4 changed JSP so that the forms action="firstpack.JustALittleTest"
> 
> I've looked at the log files but I'm not sure what to look for.
> 
> Brian
> 
> -----Original Message-----
> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
> Sent: Wednesday, July 12, 2006 7:49 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> I would check in tomcat logs directory for reasons why the servlet is 
> not available. One reason could be that classes should be in a
package:
> 
> http://tomcat.apache.org/faq/classnotfound.html
> 
> HTH,
> 
> Jon
> 
> McRaven, Brian wrote:
>> OK I did that and now my system is hanging which I guess could be an 
>> error in my code or something with the server.  I think it is my code

>> so I'll look that over.  Thanks for your help.  Sorry for the
> confusion.
>> Brian
>>
>> -----Original Message-----
>> From: David Smith [mailto:dns4@cornell.edu]
>> Sent: Tuesday, July 11, 2006 2:48 PM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>> Did you reload the webapp after making the change?  All changes to 
>> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will 
>> require a reload before they become active in tomcat.
>>
>> --David
>>
>> McRaven, Brian wrote:
>>
>>> I was able to refer to a book I have and so I dropped the .class 
>>> extensions altogether.  I get an error that requested resource is 
>>> not
> 
>>> available still.  Any suggestions on this?  My web.xml file has this
>>> entry:
>>>
>>>    <servlet>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <servlet-class>JustAlittleTest</servlet-class>
>>>    </servlet>
>>>
>>>    <servlet-mapping>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <url-pattern>/JustALittleTest</url-pattern>
>>>    </servlet-mapping>
>>>
>>> And my action attribute="JustALittleTest".
>>>
>>> Brian
>>>
>>>
>>> -----Original Message-----
>>> From: McRaven, Brian
>>> Sent: Tuesday, July 11, 2006 1:14 PM
>>> To: users@tomcat.apache.org
>>> Subject: Accessing a servlet
>>>
>>> Well I'm ticking these newbie questions off.  I have a simple 
>>> servlet
> 
>>> that I want my form to access.  I compiled the file fine and it is 
>>> called JustALittleTest.class.  I placed this file in the 
>>> ROOT/WEB-INF/classes folder.  In my JSP I have a form with some 
>>> submit buttons.  The action element of the form is set to
> ="JustALittleTest".
>>> I changed my web.xml file so it now has the following entries:
>>>
>>>    <servlet>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <servlet-class>JustAlittleTest.class</servlet-class>
>>>    </servlet>
>>>
>>>    <servlet-mapping>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <url-pattern>/JustALittleTest.class</url-pattern>
>>>    </servlet-mapping>
>>>
>>> I've tried a few changes to the above entries but I haven't gotten 
>>> it
> 
>>> right yet.  Should the servlet-class value have a .class extension?

>>> Is
>>> my url pattern accessing the correct folder?
>>>
>>> Brian
>>>
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
> e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
> e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Accessing a servlet

Posted by "McRaven, Brian" <bm...@ncr.com>.
If the url-pattern should be /firstpack/JustALittleTest then should the
form on the JSP refer to action="firstpack.JustALittleTest" or
action="firstpack/JustALittleTest" ? 

Brian 

-----Original Message-----
From: McRaven, Brian 
Sent: Wednesday, July 12, 2006 9:55 AM
To: Tomcat Users List; p@pidster.com
Subject: RE: Accessing a servlet

When I use this entry I get a request resource not found error.

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>firstpack.JustALittleTest</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/firstpack/JustALittleTest</url-pattern>
    </servlet-mapping>

Under the previous error to this one I was using an entry of:

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>JustALittleTest</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/firstpack.JustALittleTest</url-pattern>
    </servlet-mapping>

With the following entry:

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>firstpack.JustALittleTest</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/firstpack.JustALittleTest</url-pattern>
    </servlet-mapping>

I get an error of 'Error allocating a servlet instance'

Brian

-----Original Message-----
From: Pid [mailto:p@pidster.com]
Sent: Wednesday, July 12, 2006 9:46 AM
To: Tomcat Users List
Subject: Re: Accessing a servlet

<servlet>
   <servlet-name>TheServletName</servlet-name>
   <servlet-class>package.ThisIsTheClassName</servlet-class>
</servlet>
<servlet-mapping>
   <servlet-name>TheServletName</servlet-name>
   <url-pattern>/a/path/to/theservlet</url-pattern>
</servlet-mapping>

"servlet-name" is used to link the definition to the mapping.
defs are grouped together in web.xml, as are mappings.

"url-pattern" refers to the path by which you'll access the servlet.
it can any unique url on your system, and does not have to reflect the
class name.





McRaven, Brian wrote:
> I made the servlet part of a package but I'm getting a Servlet not 
> Found Exception.  The actions I took to make the servlet part of a 
> package are the following:
> 
> 1 added package line to java code, recompiled
> 2 placed new class file in new subdirectory of WEB-INF/classes folder 
> with same name of package
> 3 changed entry in web.xml file to reflect package that servlet is in 
> for the url-pattern
> 4 changed JSP so that the forms action="firstpack.JustALittleTest"
> 
> I've looked at the log files but I'm not sure what to look for.
> 
> Brian
> 
> -----Original Message-----
> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
> Sent: Wednesday, July 12, 2006 7:49 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> I would check in tomcat logs directory for reasons why the servlet is 
> not available. One reason could be that classes should be in a
package:
> 
> http://tomcat.apache.org/faq/classnotfound.html
> 
> HTH,
> 
> Jon
> 
> McRaven, Brian wrote:
>> OK I did that and now my system is hanging which I guess could be an 
>> error in my code or something with the server.  I think it is my code

>> so I'll look that over.  Thanks for your help.  Sorry for the
> confusion.
>> Brian
>>
>> -----Original Message-----
>> From: David Smith [mailto:dns4@cornell.edu]
>> Sent: Tuesday, July 11, 2006 2:48 PM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>> Did you reload the webapp after making the change?  All changes to 
>> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will 
>> require a reload before they become active in tomcat.
>>
>> --David
>>
>> McRaven, Brian wrote:
>>
>>> I was able to refer to a book I have and so I dropped the .class 
>>> extensions altogether.  I get an error that requested resource is 
>>> not
> 
>>> available still.  Any suggestions on this?  My web.xml file has this
>>> entry:
>>>
>>>    <servlet>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <servlet-class>JustAlittleTest</servlet-class>
>>>    </servlet>
>>>
>>>    <servlet-mapping>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <url-pattern>/JustALittleTest</url-pattern>
>>>    </servlet-mapping>
>>>
>>> And my action attribute="JustALittleTest".
>>>
>>> Brian
>>>
>>>
>>> -----Original Message-----
>>> From: McRaven, Brian
>>> Sent: Tuesday, July 11, 2006 1:14 PM
>>> To: users@tomcat.apache.org
>>> Subject: Accessing a servlet
>>>
>>> Well I'm ticking these newbie questions off.  I have a simple 
>>> servlet
> 
>>> that I want my form to access.  I compiled the file fine and it is 
>>> called JustALittleTest.class.  I placed this file in the 
>>> ROOT/WEB-INF/classes folder.  In my JSP I have a form with some 
>>> submit buttons.  The action element of the form is set to
> ="JustALittleTest".
>>> I changed my web.xml file so it now has the following entries:
>>>
>>>    <servlet>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <servlet-class>JustAlittleTest.class</servlet-class>
>>>    </servlet>
>>>
>>>    <servlet-mapping>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <url-pattern>/JustALittleTest.class</url-pattern>
>>>    </servlet-mapping>
>>>
>>> I've tried a few changes to the above entries but I haven't gotten 
>>> it
> 
>>> right yet.  Should the servlet-class value have a .class extension?

>>> Is
>>> my url pattern accessing the correct folder?
>>>
>>> Brian
>>>
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
> e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
> e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Accessing a servlet

Posted by "McRaven, Brian" <bm...@ncr.com>.
When I use this entry I get a request resource not found error.

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>firstpack.JustALittleTest</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/firstpack/JustALittleTest</url-pattern>
    </servlet-mapping>

Under the previous error to this one I was using an entry of:

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>JustALittleTest</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/firstpack.JustALittleTest</url-pattern>
    </servlet-mapping>

With the following entry:

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>firstpack.JustALittleTest</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/firstpack.JustALittleTest</url-pattern>
    </servlet-mapping>

I get an error of 'Error allocating a servlet instance'

Brian

-----Original Message-----
From: Pid [mailto:p@pidster.com] 
Sent: Wednesday, July 12, 2006 9:46 AM
To: Tomcat Users List
Subject: Re: Accessing a servlet

<servlet>
   <servlet-name>TheServletName</servlet-name>
   <servlet-class>package.ThisIsTheClassName</servlet-class>
</servlet>
<servlet-mapping>
   <servlet-name>TheServletName</servlet-name>
   <url-pattern>/a/path/to/theservlet</url-pattern>
</servlet-mapping>

"servlet-name" is used to link the definition to the mapping.
defs are grouped together in web.xml, as are mappings.

"url-pattern" refers to the path by which you'll access the servlet.
it can any unique url on your system, and does not have to reflect the
class name.





McRaven, Brian wrote:
> I made the servlet part of a package but I'm getting a Servlet not 
> Found Exception.  The actions I took to make the servlet part of a 
> package are the following:
> 
> 1 added package line to java code, recompiled
> 2 placed new class file in new subdirectory of WEB-INF/classes folder 
> with same name of package
> 3 changed entry in web.xml file to reflect package that servlet is in 
> for the url-pattern
> 4 changed JSP so that the forms action="firstpack.JustALittleTest"
> 
> I've looked at the log files but I'm not sure what to look for.
> 
> Brian
> 
> -----Original Message-----
> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com]
> Sent: Wednesday, July 12, 2006 7:49 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> I would check in tomcat logs directory for reasons why the servlet is 
> not available. One reason could be that classes should be in a
package:
> 
> http://tomcat.apache.org/faq/classnotfound.html
> 
> HTH,
> 
> Jon
> 
> McRaven, Brian wrote:
>> OK I did that and now my system is hanging which I guess could be an 
>> error in my code or something with the server.  I think it is my code

>> so I'll look that over.  Thanks for your help.  Sorry for the
> confusion.
>> Brian
>>
>> -----Original Message-----
>> From: David Smith [mailto:dns4@cornell.edu]
>> Sent: Tuesday, July 11, 2006 2:48 PM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>> Did you reload the webapp after making the change?  All changes to 
>> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will 
>> require a reload before they become active in tomcat.
>>
>> --David
>>
>> McRaven, Brian wrote:
>>
>>> I was able to refer to a book I have and so I dropped the .class 
>>> extensions altogether.  I get an error that requested resource is 
>>> not
> 
>>> available still.  Any suggestions on this?  My web.xml file has this
>>> entry:
>>>
>>>    <servlet>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <servlet-class>JustAlittleTest</servlet-class>
>>>    </servlet>
>>>
>>>    <servlet-mapping>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <url-pattern>/JustALittleTest</url-pattern>
>>>    </servlet-mapping>
>>>
>>> And my action attribute="JustALittleTest".
>>>
>>> Brian
>>>
>>>
>>> -----Original Message-----
>>> From: McRaven, Brian
>>> Sent: Tuesday, July 11, 2006 1:14 PM
>>> To: users@tomcat.apache.org
>>> Subject: Accessing a servlet
>>>
>>> Well I'm ticking these newbie questions off.  I have a simple 
>>> servlet
> 
>>> that I want my form to access.  I compiled the file fine and it is 
>>> called JustALittleTest.class.  I placed this file in the 
>>> ROOT/WEB-INF/classes folder.  In my JSP I have a form with some 
>>> submit buttons.  The action element of the form is set to
> ="JustALittleTest".
>>> I changed my web.xml file so it now has the following entries:
>>>
>>>    <servlet>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <servlet-class>JustAlittleTest.class</servlet-class>
>>>    </servlet>
>>>
>>>    <servlet-mapping>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <url-pattern>/JustALittleTest.class</url-pattern>
>>>    </servlet-mapping>
>>>
>>> I've tried a few changes to the above entries but I haven't gotten 
>>> it
> 
>>> right yet.  Should the servlet-class value have a .class extension?

>>> Is
>>> my url pattern accessing the correct folder?
>>>
>>> Brian
>>>
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
> e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, 
> e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Accessing a servlet

Posted by Pid <p...@pidster.com>.
<servlet>
   <servlet-name>TheServletName</servlet-name>
   <servlet-class>package.ThisIsTheClassName</servlet-class>
</servlet>
<servlet-mapping>
   <servlet-name>TheServletName</servlet-name>
   <url-pattern>/a/path/to/theservlet</url-pattern>
</servlet-mapping>

"servlet-name" is used to link the definition to the mapping.
defs are grouped together in web.xml, as are mappings.

"url-pattern" refers to the path by which you'll access the servlet.
it can any unique url on your system, and does not have to reflect the
class name.





McRaven, Brian wrote:
> I made the servlet part of a package but I'm getting a Servlet not Found
> Exception.  The actions I took to make the servlet part of a package are
> the following:
> 
> 1 added package line to java code, recompiled
> 2 placed new class file in new subdirectory of WEB-INF/classes folder
> with same name of package
> 3 changed entry in web.xml file to reflect package that servlet is in
> for the url-pattern
> 4 changed JSP so that the forms action="firstpack.JustALittleTest"
> 
> I've looked at the log files but I'm not sure what to look for.
> 
> Brian
> 
> -----Original Message-----
> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com] 
> Sent: Wednesday, July 12, 2006 7:49 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> I would check in tomcat logs directory for reasons why the servlet is
> not available. One reason could be that classes should be in a package:
> 
> http://tomcat.apache.org/faq/classnotfound.html
> 
> HTH,
> 
> Jon
> 
> McRaven, Brian wrote:
>> OK I did that and now my system is hanging which I guess could be an 
>> error in my code or something with the server.  I think it is my code 
>> so I'll look that over.  Thanks for your help.  Sorry for the
> confusion.
>> Brian
>>
>> -----Original Message-----
>> From: David Smith [mailto:dns4@cornell.edu]
>> Sent: Tuesday, July 11, 2006 2:48 PM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>> Did you reload the webapp after making the change?  All changes to 
>> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will 
>> require a reload before they become active in tomcat.
>>
>> --David
>>
>> McRaven, Brian wrote:
>>
>>> I was able to refer to a book I have and so I dropped the .class 
>>> extensions altogether.  I get an error that requested resource is not
> 
>>> available still.  Any suggestions on this?  My web.xml file has this
>>> entry:
>>>
>>>    <servlet>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <servlet-class>JustAlittleTest</servlet-class>
>>>    </servlet>
>>>
>>>    <servlet-mapping>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <url-pattern>/JustALittleTest</url-pattern>
>>>    </servlet-mapping>
>>>
>>> And my action attribute="JustALittleTest".
>>>
>>> Brian
>>>
>>>
>>> -----Original Message-----
>>> From: McRaven, Brian
>>> Sent: Tuesday, July 11, 2006 1:14 PM
>>> To: users@tomcat.apache.org
>>> Subject: Accessing a servlet
>>>
>>> Well I'm ticking these newbie questions off.  I have a simple servlet
> 
>>> that I want my form to access.  I compiled the file fine and it is 
>>> called JustALittleTest.class.  I placed this file in the 
>>> ROOT/WEB-INF/classes folder.  In my JSP I have a form with some 
>>> submit buttons.  The action element of the form is set to
> ="JustALittleTest".
>>> I changed my web.xml file so it now has the following entries:
>>>
>>>    <servlet>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <servlet-class>JustAlittleTest.class</servlet-class>
>>>    </servlet>
>>>
>>>    <servlet-mapping>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <url-pattern>/JustALittleTest.class</url-pattern>
>>>    </servlet-mapping>
>>>
>>> I've tried a few changes to the above entries but I haven't gotten it
> 
>>> right yet.  Should the servlet-class value have a .class extension?  
>>> Is
>>> my url pattern accessing the correct folder?
>>>
>>> Brian
>>>
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
> e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Accessing a servlet

Posted by Jon Wingfield <jo...@mkodo.com>.
OK. The web.xml entries should probably be something like this:

<servlet>
   <servlet-name>just-a-little-test</servlet-name>
   <servlet-class>firstpack.JustAlittleTest</servlet-class>
</servlet>
<servlet-mapping>
   <servlet-name>just-a-little-test</servlet-name>
   <url-pattern>/some/useful/mapping</url-pattern>
</servlet-mapping>

and the form action should be "/some/useful/mapping".
I changed the names so they weren't all JustAlittleTest ;)


As to the logs, I assumed there would be stacktraces in the logs for 
ClassNotFound/NoClassDefFound exceptions if the mapping was not valid.

HTH,

Jon

McRaven, Brian wrote:
> I made the servlet part of a package but I'm getting a Servlet not Found
> Exception.  The actions I took to make the servlet part of a package are
> the following:
> 
> 1 added package line to java code, recompiled
> 2 placed new class file in new subdirectory of WEB-INF/classes folder
> with same name of package
> 3 changed entry in web.xml file to reflect package that servlet is in
> for the url-pattern
> 4 changed JSP so that the forms action="firstpack.JustALittleTest"
> 
> I've looked at the log files but I'm not sure what to look for.
> 
> Brian
> 
> -----Original Message-----
> From: Jon Wingfield [mailto:jon.wingfield@mkodo.com] 
> Sent: Wednesday, July 12, 2006 7:49 AM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> I would check in tomcat logs directory for reasons why the servlet is
> not available. One reason could be that classes should be in a package:
> 
> http://tomcat.apache.org/faq/classnotfound.html
> 
> HTH,
> 
> Jon
> 
> McRaven, Brian wrote:
>> OK I did that and now my system is hanging which I guess could be an 
>> error in my code or something with the server.  I think it is my code 
>> so I'll look that over.  Thanks for your help.  Sorry for the
> confusion.
>> Brian
>>
>> -----Original Message-----
>> From: David Smith [mailto:dns4@cornell.edu]
>> Sent: Tuesday, July 11, 2006 2:48 PM
>> To: Tomcat Users List
>> Subject: Re: Accessing a servlet
>>
>> Did you reload the webapp after making the change?  All changes to 
>> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will 
>> require a reload before they become active in tomcat.
>>
>> --David
>>
>> McRaven, Brian wrote:
>>
>>> I was able to refer to a book I have and so I dropped the .class 
>>> extensions altogether.  I get an error that requested resource is not
> 
>>> available still.  Any suggestions on this?  My web.xml file has this
>>> entry:
>>>
>>>    <servlet>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <servlet-class>JustAlittleTest</servlet-class>
>>>    </servlet>
>>>
>>>    <servlet-mapping>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <url-pattern>/JustALittleTest</url-pattern>
>>>    </servlet-mapping>
>>>
>>> And my action attribute="JustALittleTest".
>>>
>>> Brian
>>>
>>>
>>> -----Original Message-----
>>> From: McRaven, Brian
>>> Sent: Tuesday, July 11, 2006 1:14 PM
>>> To: users@tomcat.apache.org
>>> Subject: Accessing a servlet
>>>
>>> Well I'm ticking these newbie questions off.  I have a simple servlet
> 
>>> that I want my form to access.  I compiled the file fine and it is 
>>> called JustALittleTest.class.  I placed this file in the 
>>> ROOT/WEB-INF/classes folder.  In my JSP I have a form with some 
>>> submit buttons.  The action element of the form is set to
> ="JustALittleTest".
>>> I changed my web.xml file so it now has the following entries:
>>>
>>>    <servlet>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <servlet-class>JustAlittleTest.class</servlet-class>
>>>    </servlet>
>>>
>>>    <servlet-mapping>
>>>       <servlet-name>JustALittleTest</servlet-name>
>>>       <url-pattern>/JustALittleTest.class</url-pattern>
>>>    </servlet-mapping>
>>>
>>> I've tried a few changes to the above entries but I haven't gotten it
> 
>>> right yet.  Should the servlet-class value have a .class extension?  
>>> Is
>>> my url pattern accessing the correct folder?
>>>
>>> Brian
>>>



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Accessing a servlet

Posted by "McRaven, Brian" <bm...@ncr.com>.
I made the servlet part of a package but I'm getting a Servlet not Found
Exception.  The actions I took to make the servlet part of a package are
the following:

1 added package line to java code, recompiled
2 placed new class file in new subdirectory of WEB-INF/classes folder
with same name of package
3 changed entry in web.xml file to reflect package that servlet is in
for the url-pattern
4 changed JSP so that the forms action="firstpack.JustALittleTest"

I've looked at the log files but I'm not sure what to look for.

Brian

-----Original Message-----
From: Jon Wingfield [mailto:jon.wingfield@mkodo.com] 
Sent: Wednesday, July 12, 2006 7:49 AM
To: Tomcat Users List
Subject: Re: Accessing a servlet

I would check in tomcat logs directory for reasons why the servlet is
not available. One reason could be that classes should be in a package:

http://tomcat.apache.org/faq/classnotfound.html

HTH,

Jon

McRaven, Brian wrote:
> OK I did that and now my system is hanging which I guess could be an 
> error in my code or something with the server.  I think it is my code 
> so I'll look that over.  Thanks for your help.  Sorry for the
confusion.
> 
> Brian
> 
> -----Original Message-----
> From: David Smith [mailto:dns4@cornell.edu]
> Sent: Tuesday, July 11, 2006 2:48 PM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> Did you reload the webapp after making the change?  All changes to 
> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will 
> require a reload before they become active in tomcat.
> 
> --David
> 
> McRaven, Brian wrote:
> 
>> I was able to refer to a book I have and so I dropped the .class 
>> extensions altogether.  I get an error that requested resource is not

>> available still.  Any suggestions on this?  My web.xml file has this
>> entry:
>>
>>    <servlet>
>>       <servlet-name>JustALittleTest</servlet-name>
>>       <servlet-class>JustAlittleTest</servlet-class>
>>    </servlet>
>>
>>    <servlet-mapping>
>>       <servlet-name>JustALittleTest</servlet-name>
>>       <url-pattern>/JustALittleTest</url-pattern>
>>    </servlet-mapping>
>>
>> And my action attribute="JustALittleTest".
>>
>> Brian
>>
>>
>> -----Original Message-----
>> From: McRaven, Brian
>> Sent: Tuesday, July 11, 2006 1:14 PM
>> To: users@tomcat.apache.org
>> Subject: Accessing a servlet
>>
>> Well I'm ticking these newbie questions off.  I have a simple servlet

>> that I want my form to access.  I compiled the file fine and it is 
>> called JustALittleTest.class.  I placed this file in the 
>> ROOT/WEB-INF/classes folder.  In my JSP I have a form with some 
>> submit buttons.  The action element of the form is set to
="JustALittleTest".
>> I changed my web.xml file so it now has the following entries:
>>
>>    <servlet>
>>       <servlet-name>JustALittleTest</servlet-name>
>>       <servlet-class>JustAlittleTest.class</servlet-class>
>>    </servlet>
>>
>>    <servlet-mapping>
>>       <servlet-name>JustALittleTest</servlet-name>
>>       <url-pattern>/JustALittleTest.class</url-pattern>
>>    </servlet-mapping>
>>
>> I've tried a few changes to the above entries but I haven't gotten it

>> right yet.  Should the servlet-class value have a .class extension?  
>> Is
> 
>> my url pattern accessing the correct folder?
>>
>> Brian
>>



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Accessing a servlet

Posted by Jon Wingfield <jo...@mkodo.com>.
I would check in tomcat logs directory for reasons why the servlet is 
not available. One reason could be that classes should be in a package:

http://tomcat.apache.org/faq/classnotfound.html

HTH,

Jon

McRaven, Brian wrote:
> OK I did that and now my system is hanging which I guess could be an
> error in my code or something with the server.  I think it is my code so
> I'll look that over.  Thanks for your help.  Sorry for the confusion.
> 
> Brian
> 
> -----Original Message-----
> From: David Smith [mailto:dns4@cornell.edu] 
> Sent: Tuesday, July 11, 2006 2:48 PM
> To: Tomcat Users List
> Subject: Re: Accessing a servlet
> 
> Did you reload the webapp after making the change?  All changes to
> WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will require
> a reload before they become active in tomcat.
> 
> --David
> 
> McRaven, Brian wrote:
> 
>> I was able to refer to a book I have and so I dropped the .class 
>> extensions altogether.  I get an error that requested resource is not 
>> available still.  Any suggestions on this?  My web.xml file has this
>> entry:
>>
>>    <servlet>
>>       <servlet-name>JustALittleTest</servlet-name>
>>       <servlet-class>JustAlittleTest</servlet-class>
>>    </servlet>
>>
>>    <servlet-mapping>
>>       <servlet-name>JustALittleTest</servlet-name>
>>       <url-pattern>/JustALittleTest</url-pattern>
>>    </servlet-mapping>
>>
>> And my action attribute="JustALittleTest".
>>
>> Brian
>>
>>
>> -----Original Message-----
>> From: McRaven, Brian
>> Sent: Tuesday, July 11, 2006 1:14 PM
>> To: users@tomcat.apache.org
>> Subject: Accessing a servlet
>>
>> Well I'm ticking these newbie questions off.  I have a simple servlet 
>> that I want my form to access.  I compiled the file fine and it is 
>> called JustALittleTest.class.  I placed this file in the 
>> ROOT/WEB-INF/classes folder.  In my JSP I have a form with some submit 
>> buttons.  The action element of the form is set to ="JustALittleTest".
>> I changed my web.xml file so it now has the following entries:
>>
>>    <servlet>
>>       <servlet-name>JustALittleTest</servlet-name>
>>       <servlet-class>JustAlittleTest.class</servlet-class>
>>    </servlet>
>>
>>    <servlet-mapping>
>>       <servlet-name>JustALittleTest</servlet-name>
>>       <url-pattern>/JustALittleTest.class</url-pattern>
>>    </servlet-mapping>
>>
>> I've tried a few changes to the above entries but I haven't gotten it 
>> right yet.  Should the servlet-class value have a .class extension?  Is
> 
>> my url pattern accessing the correct folder?
>>
>> Brian
>>



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Accessing a servlet

Posted by "McRaven, Brian" <bm...@ncr.com>.
OK I did that and now my system is hanging which I guess could be an
error in my code or something with the server.  I think it is my code so
I'll look that over.  Thanks for your help.  Sorry for the confusion.

Brian

-----Original Message-----
From: David Smith [mailto:dns4@cornell.edu] 
Sent: Tuesday, July 11, 2006 2:48 PM
To: Tomcat Users List
Subject: Re: Accessing a servlet

Did you reload the webapp after making the change?  All changes to
WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will require
a reload before they become active in tomcat.

--David

McRaven, Brian wrote:

> I was able to refer to a book I have and so I dropped the .class 
>extensions altogether.  I get an error that requested resource is not 
>available still.  Any suggestions on this?  My web.xml file has this
>entry:
>
>    <servlet>
>       <servlet-name>JustALittleTest</servlet-name>
>       <servlet-class>JustAlittleTest</servlet-class>
>    </servlet>
>
>    <servlet-mapping>
>       <servlet-name>JustALittleTest</servlet-name>
>       <url-pattern>/JustALittleTest</url-pattern>
>    </servlet-mapping>
>
>And my action attribute="JustALittleTest".
>
>Brian
>
>
>-----Original Message-----
>From: McRaven, Brian
>Sent: Tuesday, July 11, 2006 1:14 PM
>To: users@tomcat.apache.org
>Subject: Accessing a servlet
>
>Well I'm ticking these newbie questions off.  I have a simple servlet 
>that I want my form to access.  I compiled the file fine and it is 
>called JustALittleTest.class.  I placed this file in the 
>ROOT/WEB-INF/classes folder.  In my JSP I have a form with some submit 
>buttons.  The action element of the form is set to ="JustALittleTest".
>I changed my web.xml file so it now has the following entries:
>
>    <servlet>
>       <servlet-name>JustALittleTest</servlet-name>
>       <servlet-class>JustAlittleTest.class</servlet-class>
>    </servlet>
>
>    <servlet-mapping>
>       <servlet-name>JustALittleTest</servlet-name>
>       <url-pattern>/JustALittleTest.class</url-pattern>
>    </servlet-mapping>
>
>I've tried a few changes to the above entries but I haven't gotten it 
>right yet.  Should the servlet-class value have a .class extension?  Is

>my url pattern accessing the correct folder?
>
>Brian
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, 
>e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>  
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Accessing a servlet

Posted by David Smith <dn...@cornell.edu>.
Did you reload the webapp after making the change?  All changes to 
WEB-INF/web.xml or files in WEB-INF/classes and WEB-INF/lib will require 
a reload before they become active in tomcat.

--David

McRaven, Brian wrote:

> I was able to refer to a book I have and so I dropped the .class
>extensions altogether.  I get an error that requested resource is not
>available still.  Any suggestions on this?  My web.xml file has this
>entry:
>
>    <servlet>
>       <servlet-name>JustALittleTest</servlet-name>
>       <servlet-class>JustAlittleTest</servlet-class>
>    </servlet>
>
>    <servlet-mapping>
>       <servlet-name>JustALittleTest</servlet-name>
>       <url-pattern>/JustALittleTest</url-pattern>
>    </servlet-mapping>
>
>And my action attribute="JustALittleTest".
>
>Brian
>
>
>-----Original Message-----
>From: McRaven, Brian 
>Sent: Tuesday, July 11, 2006 1:14 PM
>To: users@tomcat.apache.org
>Subject: Accessing a servlet
>
>Well I'm ticking these newbie questions off.  I have a simple servlet
>that I want my form to access.  I compiled the file fine and it is
>called JustALittleTest.class.  I placed this file in the
>ROOT/WEB-INF/classes folder.  In my JSP I have a form with some submit
>buttons.  The action element of the form is set to ="JustALittleTest".
>I changed my web.xml file so it now has the following entries:
>
>    <servlet>
>       <servlet-name>JustALittleTest</servlet-name>
>       <servlet-class>JustAlittleTest.class</servlet-class>
>    </servlet>
>
>    <servlet-mapping>
>       <servlet-name>JustALittleTest</servlet-name>
>       <url-pattern>/JustALittleTest.class</url-pattern>
>    </servlet-mapping>
>
>I've tried a few changes to the above entries but I haven't gotten it
>right yet.  Should the servlet-class value have a .class extension?  Is
>my url pattern accessing the correct folder?
>
>Brian
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>  
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Accessing a servlet

Posted by "McRaven, Brian" <bm...@ncr.com>.
 I was able to refer to a book I have and so I dropped the .class
extensions altogether.  I get an error that requested resource is not
available still.  Any suggestions on this?  My web.xml file has this
entry:

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>JustAlittleTest</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/JustALittleTest</url-pattern>
    </servlet-mapping>

And my action attribute="JustALittleTest".

Brian


-----Original Message-----
From: McRaven, Brian 
Sent: Tuesday, July 11, 2006 1:14 PM
To: users@tomcat.apache.org
Subject: Accessing a servlet

Well I'm ticking these newbie questions off.  I have a simple servlet
that I want my form to access.  I compiled the file fine and it is
called JustALittleTest.class.  I placed this file in the
ROOT/WEB-INF/classes folder.  In my JSP I have a form with some submit
buttons.  The action element of the form is set to ="JustALittleTest".
I changed my web.xml file so it now has the following entries:

    <servlet>
       <servlet-name>JustALittleTest</servlet-name>
       <servlet-class>JustAlittleTest.class</servlet-class>
    </servlet>

    <servlet-mapping>
       <servlet-name>JustALittleTest</servlet-name>
       <url-pattern>/JustALittleTest.class</url-pattern>
    </servlet-mapping>

I've tried a few changes to the above entries but I haven't gotten it
right yet.  Should the servlet-class value have a .class extension?  Is
my url pattern accessing the correct folder?

Brian

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org