Servlet invoker and web.xml problem, please help

Y

YourFriend

I am not sure about function of servlet invoker on $TOMCAT/conf/web.xml
and web.xml on /WEB-INF

If I have setup the servlet invoker on $TOMCAT/conf/web.xml, so I don't have
type full path of servlet program on html program.

this html program is save on html/message.html

<html>
<head>
<title>Message</title>
</head>

<body>
<form action="../servlet/Test1" method="post">
<font size="3"><B>Test Send a message</B></font><BR><BR>
Title: <input type="text" name="aName" size="20"><br><br>
Message:<br>
<textarea name="aText" rows="5" cols="30" wrap="hard"></textarea><br><br>

<input type="submit" value="Send message to other servlet"><br>
<font color="#0000FF">
<input type="reset" value="Reset All">
</font>
</form>
</body>
</html>

The following is my /WEB-INF/web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>Test1</servlet-name>
<servlet-class>com.ShowRequestHeaders</servlet-class>
</servlet>
</web-app>

If I don't want setup servlet invoker on $TOMCAT/conf/web.xml, how can I do
?
 
H

hiwa

YourFriend said:
I am not sure about function of servlet invoker on $TOMCAT/conf/web.xml
and web.xml on /WEB-INF

If I have setup the servlet invoker on $TOMCAT/conf/web.xml, so I don't have
type full path of servlet program on html program.

this html program is save on html/message.html

<html>
<head>
<title>Message</title>
</head>

<body>
<form action="../servlet/Test1" method="post">
<font size="3"><B>Test Send a message</B></font><BR><BR>
Title: <input type="text" name="aName" size="20"><br><br>
Message:<br>
<textarea name="aText" rows="5" cols="30" wrap="hard"></textarea><br><br>

<input type="submit" value="Send message to other servlet"><br>
<font color="#0000FF">
<input type="reset" value="Reset All">
</font>
</form>
</body>
</html>

The following is my /WEB-INF/web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>Test1</servlet-name>
<servlet-class>com.ShowRequestHeaders</servlet-class>
</servlet>
</web-app>

If I don't want setup servlet invoker on $TOMCAT/conf/web.xml, how can I do
?
[If you do it in the app web.xml]
<servlet><servlet-name>DisabledSorry</servlet-name>
<servlet-class>SorryServlet</servlet-class></servlet>

<servlet-mapping><servlet-name>DisabledSorry
</servlet-name><url-pattern>/servlet/*</url-pattern>
</servlet-mapping>

[or, If you do it in the Tomcat/conf/web.xml]
<!--
<servlet-mapping><servlet-name>invoker
</servlet-name><url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
-->
 
Y

YourFriend

Hi hiwa

Can you tell me why I have setup the servlet-mapping when I have
remarked the invoker on $TOMCAT/conf/web.xml ?

Because I am not sure about it, every why I have type
"/servlet/abc_servlet" on HTML file (note: "abc_servlet" is the servlet
program)

Thanks

hiwa said:
"YourFriend" <[email protected]> wrote in message
I am not sure about function of servlet invoker on $TOMCAT/conf/web.xml
and web.xml on /WEB-INF

If I have setup the servlet invoker on $TOMCAT/conf/web.xml, so I don't have
type full path of servlet program on html program.

this html program is save on html/message.html

<html>
<head>
<title>Message</title>
</head>

<body>
<form action="../servlet/Test1" method="post">
<font size="3"><B>Test Send a message</B></font><BR><BR>
Title: <input type="text" name="aName" size="20"><br><br>
Message:<br>
<textarea name="aText" rows="5" cols="30"
wrap="hard"> said:
<input type="submit" value="Send message to other
servlet"> said:
<font color="#0000FF">
<input type="reset" value="Reset All">
</font>
</form>
</body>
</html>

The following is my /WEB-INF/web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>Test1</servlet-name>
<servlet-class>com.ShowRequestHeaders</servlet-class>
</servlet>
</web-app>

If I don't want setup servlet invoker on $TOMCAT/conf/web.xml, how can I do
?
[If you do it in the app web.xml]
<servlet><servlet-name>DisabledSorry</servlet-name>
<servlet-class>SorryServlet</servlet-class></servlet>

<servlet-mapping><servlet-name>DisabledSorry
</servlet-name><url-pattern>/servlet/*</url-pattern>
</servlet-mapping>

[or, If you do it in the Tomcat/conf/web.xml]
<!--
<servlet-mapping><servlet-name>invoker
</servlet-name><url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
-->
 
H

hiwa

If you modified -- commented out-- Tomcat/conf/web.xml entry for the
invoker servlet, you don't need to add new entries onto the
WEB-INF/web.xml. Those two are just alternatives.

YourFriend said:
Hi hiwa

Can you tell me why I have setup the servlet-mapping when I have
remarked the invoker on $TOMCAT/conf/web.xml ?

Because I am not sure about it, every why I have type
"/servlet/abc_servlet" on HTML file (note: "abc_servlet" is the servlet
program)

Thanks

hiwa said:
"YourFriend" <[email protected]> wrote in message
I am not sure about function of servlet invoker on $TOMCAT/conf/web.xml
and web.xml on /WEB-INF

If I have setup the servlet invoker on $TOMCAT/conf/web.xml, so I don't have
type full path of servlet program on html program.

this html program is save on html/message.html

<html>
<head>
<title>Message</title>
</head>

<body>
<form action="../servlet/Test1" method="post">
<font size="3"><B>Test Send a message</B></font><BR><BR>
Title: <input type="text" name="aName" size="20"><br><br>
Message:<br>
<textarea name="aText" rows="5" cols="30"
wrap="hard"> said:
<input type="submit" value="Send message to other
servlet"> said:
<font color="#0000FF">
<input type="reset" value="Reset All">
</font>
</form>
</body>
</html>

The following is my /WEB-INF/web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>Test1</servlet-name>
<servlet-class>com.ShowRequestHeaders</servlet-class>
</servlet>
</web-app>

If I don't want setup servlet invoker on $TOMCAT/conf/web.xml, how can I do
?
[If you do it in the app web.xml]
<servlet><servlet-name>DisabledSorry</servlet-name>
<servlet-class>SorryServlet</servlet-class></servlet>

<servlet-mapping><servlet-name>DisabledSorry
</servlet-name><url-pattern>/servlet/*</url-pattern>
</servlet-mapping>

[or, If you do it in the Tomcat/conf/web.xml]
<!--
<servlet-mapping><servlet-name>invoker
</servlet-name><url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
-->
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,573
Members
45,046
Latest member
Gavizuho

Latest Threads

Top