当前位置:编程学习 > JSP >>

JSP编写登录页面问题

用eclipse编写了登录页面,jsp文件放在workspace的reg目录下,运行时http://localhost:8080/reg/login.jsp这样是对的,但http://localhost:8080/reg/这样就出现了这样的错误HTTP Status 404 - /reg/ type Status report message /reg/ description The requested resource (/reg/) is not available. 请问要怎么修改
追问:本人初学,请问怎么设啊,麻烦详细点我用的tomcat,而且直接在eclipse里面运行的我是直接在eclipse里面运行的,把tomcat部署到eclipse里了,web.xml改了怎么没用啊
答案:因为你的JSP服务器没有设置默认文档啊?提示你页面不存在啊。你需把login.jsp设置为默认文档即可! 
一般JSP服务器的默认文档为index.jsp、index.htm、index.html、default.jsp
其他:这样肯定是错误的了。你用的应该是tomcat ,而配置又关了列目录。
如果你要把login.jsp 设为默认页的话。
在web.xml 中增加:
  <welcome-file-list>
  <welcome-file>login.jsp</welcome-file>
  </welcome-file-list> 在TOMCAT下面的CONF/web.xml 中的<welcome-file-list>与</welcome-file-list>之间增加  
<welcome-file-list>
  <welcome-file>login.jsp</welcome-file>
  </welcome-file-list> 

上一个:jsp <input type="text" value="" />每次打开页面,想让value为本月的第一天的时间yyyy-mm-dd
下一个:jsp中如何操作完回到本页

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,