Servlet中 XML 的路径和HTML提交的…
2014-07-21 14:32
344 查看
SERVLET的各主要目录路径
\webapps\my\WEB-INF\web.xml
\webapps\my\HelloWorldServlet
\webapps\my\WEB-INF\classes\HelloWorldServlet.class
\webapps\my\index.html
XML的样例
@xmlns="http://java.sun.com/xml/ns/javaee"
@xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
@http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
index.jsp</@welcome-file>
</@welcome-file-list>
my<@/servlet-name>
HelloWorldServlet<@/servlet-class>
<@/servlet>
my<@/servlet-name>
/HelloWorldServlet<@/url-pattern>
<@/servlet-mapping>
<@/web-app> 注意:Helloworldservlet前要加/
HTML 样例
<@FORM action=/my/HelloWorldServlet method=post>
<@input type=text name=test>
<@input type=submit value="提交">
</@form>
注意:HTML文件中的路径需要包含/MY
如果是my/... 则是在相对路径,会INDEX.html目录下
找my这个目录
\webapps\my\WEB-INF\web.xml
\webapps\my\HelloWorldServlet
\webapps\my\WEB-INF\classes\HelloWorldServlet.class
\webapps\my\index.html
XML的样例
@xmlns="http://java.sun.com/xml/ns/javaee"
@xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
@http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
index.jsp</@welcome-file>
</@welcome-file-list>
my<@/servlet-name>
HelloWorldServlet<@/servlet-class>
<@/servlet>
my<@/servlet-name>
/HelloWorldServlet<@/url-pattern>
<@/servlet-mapping>
<@/web-app> 注意:Helloworldservlet前要加/
HTML 样例
<@FORM action=/my/HelloWorldServlet method=post>
<@input type=text name=test>
<@input type=submit value="提交">
</@form>
注意:HTML文件中的路径需要包含/MY
如果是my/... 则是在相对路径,会INDEX.html目录下
找my这个目录
相关文章推荐
- html页面提交数据,利用servlet接收数据并写进xml中
- HTML相对路径(Relative&nbsp;Path)和绝…
- html页面提交数据,利用servlet接收数据并写进xml中
- XML&nbsp;中的常见问题&nbsp;(四)
- xml 基础 《 xml+xsl=>html 》
- 在.NET&nbsp;Framework中轻松处理XML数据(三)
- xml + xsl -> html
- XML&nbsp;中的常见问题&nbsp;(三)
- WebService开发时错误,Received content of invalid Content-Type setting:text/html - SOAP expects "text/xml"
- 在.NET&nbsp;Framework中轻松处理XML数据(五)
- 一个简单的XML&nbsp;Schema的例子
- XML&nbsp;中的常见问题&nbsp;(二)
- 客户端发现响应内容类型为“text/html; charset=utf-8”,但应该是“text/xml"
- 把HTML表单提交的数据转化成XML文件
- .NET XML Comments & HTML/CHM Help Documentation
- 在.NET&nbsp;Framework中轻松处理XML数据(四)
- Jsp&Servelet 学习笔记- 映射一个Servlet实名到web.xml中
- web services&amp;xml--xml与html的结合
- XML&nbsp;中的常见问题&nbsp;(一)
- 在.NET&nbsp;Framework中轻松处理XML数据(一)