Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

servlet

  Asked By: Lorenzo    Date: Jan 17    Category: Java    Views: 546
  

I will give you the exact details below.

I have folder called mvc in the /defaultwebapp ( /defaultwebapp/mvc) inside mvc folder i have one jsp page its name is Eshop.jsp in the form tag i have given action="/quickShoppingServlet".( Note I have give the mapping name of the servlet my original name of the servlet is ShoppingServlet)

I have servlet in /defaultwebapp/classes/ShoppingServlet. The ShoppingServlet imports a class name cd which is in the folder name called /defaultwebapp/classes/shopping/cd/

I have changed my web.xml


<servlet-name>ShoppingServlet</servlet-name>
<servlet-class>ShoppingServlet</servlet-class>.

<servlet-mapping>
<servlet-name>ShoppingServlet</servlet-name>
<url-pattern>/quickShoppingServlet</url-pattern>
</servlet-mapping>

I have give the quickShoppingServlet in the form tag.

Can now figure out the problem. I am still couldnt access the servlet from the jsp. Everytime i chagned in the web.xml i restarted weblogic default server (is it required to restart the server everytime? i am using trail version weblogic6.1)

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Hugo Williams     Answered On: Jan 17

Did u set the classpath for the jdk and the path where you placed the servlet.

%WL_HOME%myserver\servletclasses.

Try this option and also try to edit the weblogic.properties file.

Find for

#weblogic.httpd.register.servlets=weblogic.servlet.ServletServlet

and replace it by

weblogic.httpd.register.servlets=weblogic.servlet.ServletServlet

 
Answer #2    Answered By: Amelia Schmidt     Answered On: Jan 17

Very simple, just define a packaging system for your servlet  classes. Some of application servers don't like a servlet without packaging.


<servlet>
<servlet-name>webTierEntryPoint</servlet-name>
<display-name>HTML Client Front Controller Servlet</display-name>
<description>no description</description>
<!-- here is the point: it cannot be just a MainSerlvet without any package -->
<servlet-class>com.nirvana.components.waf.controller.web.MainServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>webTierEntryPoint</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

 
Didn't find what you were looking for? Find more on servlet Or get search suggestion and latest updates.




Tagged: