Is a JSP file required to log in to web.xml

I mentioned several sites, but still I do not get the exact picture. If we create a servlet and use the html form in the action tag, we will create an entry in web.xml, if we do the same for the jsp file, do we need to make an entry in web.xml?

Whenever we create a new jsp file, do we need to make an entry in the web.xml file? When should we make a record and when there is no need for this.

Please help me in understanding ...

+4
source share
4 answers

, . web.xml . , web.xml tomcat $TOMCAT_HOME/conf foder.

<servlet-mapping>
        <servlet-name>jsp</servlet-name>
        <url-pattern>*.jsp</url-pattern>
        <url-pattern>*.jspx</url-pattern>
    </servlet-mapping>

jsp .

+3

action html form, web.xml, jsp, web.xml?

, .

, JSP , web.xml?

.

jsp, ,

<filter-name>MyFilter</filter-name>
<url-pattern>Some.jsp</url-pattern>
+1

, jsp, web.xml?

, , jsp URL-.

+1

I don’t think it’s necessary to put the name of the JSP file in web.xml (I can only imagine one case - a list of welcome files, where you can enter the name of the JSP if you want).

And I don't know if we can actually put the JSP file in web.xml (don’t remember any tags or anything that might contain this data).

0
source

All Articles