• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

call servlet from a jsp

 
nitin kumar
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Im new to Servlet.In my web.xml
<servlet>
<servlet-name>Hello</servlet-name>
<servlet-class>exercise.HelloWorldServlet</servlet-class>
<display-name>Hello Servlet</display-name>
<description>Hello, Servlet!</description>
<init-param>
<param-name>aaa</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>numMax</param-name>
<param-value>5</param-value>
</init-param>
</servlet>

I need to call this servlet from a jsp .So can I use
this code

<jsp:forward page="/servlet/Hello">
</jsp:forward>

bye
nitin
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

With a correct web.xml, you should not need the "/servlet/" see the Invoker servlet faq.
I'm assuming that both the JSP and servlet are in the same "web application"
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic