eclipse开发structs 异常
来源:互联网 发布:淘宝内购群 编辑:程序博客网 时间:2024/06/05 19:13
elipsejuno开发struts2:
1.新建一web工程
工程右键属性添加扩展struts2jar包并不能部署到文件引用上。
2.在WebContent下的WEB-INF目录下的lib目录上导入struts2的lib下的JAR包。这样却可以部署到文件引用上。【在myEclipse上直接工程右键添加JAR包即可】
3.在WebContent下新建一个JSP首页文件:request.getContextPath()获取根目录地址;*.do映射到web.xml的<servlet>配置
<body>
<form action=" <%=request.getContextPath() %>/login.do " method="post">
username:<input type="text" name="name" /><br>
password:<input type="password" name="password" /><br>
<input type="submit" value="login"><br>
request.getContextPath()<input type="text" name="name" value=<%=request.getContextPath()%> /><br>
</form>
</body>
=================
<web-app id="Webapp_ID">
<servlet>
<servlet-name>config</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>Action</param-name>
<param-value>/WEB-INF/structs-config.xml</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>config</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>
======================<structs-config.xml>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>
<form-beans>
<form-bean name="login" type="com.itstruct.LoginForm">
</form-bean>
</form-beans>
<action-mappings>
<action path="/login" type="com.itstruct.LoginAction" name="login" >
<forward name="longinSuccess" path="/loginSuccess.jsp"></forward>
<forward name="longinFailure" path="/loginFailure.jsp"></forward>
</action>
</action-mappings>
</struts-config>
==================================
<form action=" <%=request.getContextPath() %>/login.do " method="post">
- eclipse开发structs 异常
- 第七章 eclipse中开发structs
- Structs开发整理
- eclipse,structs 等下载地址
- 如何配置基于eclipse的easy structs插件,并介绍了如何结合使用easy structs和eclipes来开发struts的应用
- 开发structs的工具-myeclipse
- Eclipse插件开发异常集锦
- structs
- structs
- structs
- Structs
- Structs
- Structs
- structs
- structs
- Structs
- structs登陆、单例模式、自定义异常
- Eclipse插件开发中的异常处理?
- 写code的规范
- 在C#中用JQuery做弹窗效果!
- XML读写操作之DOM4J
- 正则表达式收集
- Linux 套接字编程中的 5 个隐患
- eclipse开发structs 异常
- Linux下Socket编程的端口问题( Bind(): Address already in use )
- iOS开发16:使用Navigation Controller切换视图
- Android Theme使用总结
- Linux中的批量操作和文件统计问题
- 文件服务器更换用户登录
- 快速的字符串查找算法(Boyer-Moore)
- JForum源码分析
- .net获取用户电脑名,IP,当前电脑用户