difference between jsp and servlet(i have doubt in deployment descriptor)

Hi!

In servlet-->we are using deployment descriptor for servlet to run.

In JSP-->,JSP is converted as a servlet and then executed the request.So,it need deployment descriptor .But.we are not using deployment descriptor .

why?

I want to know the reason..............

anyone give clear answer to me.

[341 byte] By [san_sama] at [2007-11-27 2:56:25]
# 1

There is a deployment descriptor.

It is hidden in the standard web.xml for all apps.

It basically maps all .jsp files to a specific process.

In Tomcat you can find it in [TOMCAT]/conf/web.xml

Looks something like this:

<servlet>

<servlet-name>jsp</servlet-name>

<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>

<init-param>

<param-name>fork</param-name>

<param-value>false</param-value>

</init-param>

<init-param>

<param-name>xpoweredBy</param-name>

<param-value>false</param-value>

</init-param>

<load-on-startup>3</load-on-startup>

</servlet>

<!-- The mapping for the JSP servlet -->

<servlet-mapping>

<servlet-name>jsp</servlet-name>

<url-pattern>*.jsp</url-pattern>

</servlet-mapping>

evnafetsa at 2007-7-12 3:34:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
hi! thanks for your explanation.But,i need some more explanation about this topic
san_sama at 2007-7-12 3:34:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
i don't have this lines in my web.xml.But,its running correctly <!-- The mapping for the JSP servlet --><servlet-mapping><servlet-name>jsp</servlet-name><url-pattern>*.jsp</url-pattern></servlet-mapping>
san_sama at 2007-7-12 3:34:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

> In JSP-->,JSP is converted as a servlet and then

> executed the request.So,it need deployment descriptor

> .But.we are not using deployment descriptor .

> why?

Because you don't need to care about it. The applicationserver should care about parsing JSP's through the default JspServlet.

If you want to add some custom servlets for handling business logic, there the deployment descriptor in web.xml is for.

BalusCa at 2007-7-12 3:34:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...