关于struts中的问题 比如超级连接是这样的<a herf="aaaaa.do"></a>我想让用户点击这个以后我的一个action这个中的一个方法开始执行,这个需要怎么写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个题目很大哦,你先得写好配置文件,最好继承下内置的Struts action 比如 LookupDispatchAction.用配置文件告诉系统用哪个Action的哪个方法执行/. 仅是页面转向问题的话 还可以向你那么用如果用到action的话 在struts-config.xml指定下action的forword 重写Action的excute方法, 调用你的这个方法即可 dispatchAction啊,***.do?method=方法名&参数= dispatchAction啊,***.do?method=方法名&参数=-----------------------------------------------这个能详细点说吗 public xxxxAction extends DispatchAction{ public ActionForward methodName( ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception { ...... }}在struts-config.xml中<action parameter="method" path="/package/loginAction" type="package.xxxxxxAction" validate="false" ><forward ..../></action>jsp页面<html:form action="/package/loginAction.do?method=methodName¶mter=xxxxxx" method="post">...</html:form> struts-config.xml<action path="/saveSubscription" type="org.apache.struts.actions.DispatchAction" name="subscriptionForm" scope="request" input="/subscription.jsp" parameter="method"/>parameter的属性值是可以任意起的,只要你记得在传参数的时候统一就可以了。比如我写了一个类似这样的Action,它继承自DispatchAction类,包含了三个操作方法,有Add(),Update(),Delete()。当我想要调用这个Action的Update操作时,提交的URL应该类似这样的:http://localhost:8080/myapp/saveSubscription.do?method=update 问一个访问servlet的问题 jsp中setProperty的问题,在线等 页面缓存问题!!! 请问一下,像一个日期字符串(2008-09-01)这样的转换成date类型应该怎么做 jsp自定义标签的一个问题 求在Struts分页技术源码?在线等 weblogic连接池的问题,我实在是有点菜! 模板下载代码 如何控制图片显示的位置和大小?html电子教程上说得太简单了 大侠帮忙:resin+apache? jsp中如何打开Excel文件,比如打开1.xl然后关闭1.xls? 链接打开中文名称word文档,显示不存在。
你先得写好配置文件,最好继承下内置的Struts action 比如 LookupDispatchAction.
用配置文件告诉系统用哪个Action的哪个方法执行/.
如果用到action的话 在struts-config.xml指定下action的forword
这个能详细点说吗
public ActionForward methodName(
ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws Exception {
......
}
}在struts-config.xml中
<action parameter="method" path="/package/loginAction" type="package.xxxxxxAction" validate="false" >
<forward ..../>
</action>jsp页面
<html:form action="/package/loginAction.do?method=methodName¶mter=xxxxxx" method="post">...
</html:form>
<action path="/saveSubscription"
type="org.apache.struts.actions.DispatchAction"
name="subscriptionForm" scope="request" input="/subscription.jsp"
parameter="method"/>
parameter的属性值是可以任意起的,只要你记得在传参数的时候统一就可以了。比如我写了一个类似这样的Action,它继承自DispatchAction类,包含了三个操作方法,有Add(),Update(),Delete()。当我想要调用这个Action的Update操作时,提交的URL应该类似这样的:
http://localhost:8080/myapp/saveSubscription.do?method=update