我创建了一个JSP文件。sample.jsp<%@ page pageEncoding="UTF-8"%><!DOCTYPE html><html>
<head>
<title>Insert title here</title>
</head>
<body>
This is jsp program </body></html>我把它放在samplejsp项目。samplejsp
`-- WebContent
`-- WEB-INF
`-- sample.jsp我在下面的URL上打开它。http://localhost:8080/samplejsp/sample.jsp但它显示了浏览器中的以下错误。404错误请求的资源(/sample.jsp)不可用。JSP in/Web-INF返回“HTTP状态404请求的资源不可用”
3 回答
慕码人2483693
TA贡献1860条经验 获得超9个赞
sample.jsp
/WEB-INF
/WEB-INF
.
samplejsp `-- WebContent |-- WEB-INF `-- sample.jsp
/WEB-INF
doGet()
request.getRequestDispatcher("/WEB-INF/sample.jsp").forward(request, response);
另见:
江户川乱折腾
TA贡献1851条经验 获得超5个赞
src |-html\|-jsp\
<form action="sample.jsp" method=get> <input type =submit value="submit"></form>
编辑
Helenr
TA贡献1780条经验 获得超4个赞
sample.html
http://localhost:8080/samplejsp/sample.html
sample.jsp
http://localhost:8080/samplejsp/sample.jsp
<form action>
http://localhost:8080/samplejsp/sample.jsp
sample.jsp
<form action="sample.jsp">
添加回答
举报
0/150
提交
取消