struts

struts 1.2+ 使用 通配符映射 进行 action 的分发

风格不统一 提交于 2021-02-15 13:06:18
Using Wildcards in ActionMappings [Since Apache Struts 1.2.0] As an application grows in size, so will the number of action mappings. Wildcards can be used to combine similar mappings into one more generic mapping. The best way to explain wildcards is to show an example and walk through how it works. This example modifies the previous mapping in the ActionMapping Example section to use wildcards to match all pages that start with /edit: <!-- Generic edit* mapping --> <action path="/edit*" type="org.apache.struts.webapp.example.Edit{1}Action" name="{1}Form" scope="request" validate="false">

How can we append 2 strings in Struts

醉酒当歌 提交于 2021-02-07 21:52:17
问题 I need to append 2 String class variables using Struts 2 I tried like this <s:set var="Name" value="#variable1+#variable2"/> but no result. 回答1: Use OGNL to force evaluation of concatenation operation <s:set var="Name" value="%{#variable1 + #variable2}"/> 回答2: it is also working. <s:set var="Name" value="#variable1+''+#variable2"/> 来源: https://stackoverflow.com/questions/23789198/how-can-we-append-2-strings-in-struts

How can we append 2 strings in Struts

心已入冬 提交于 2021-02-07 21:50:52
问题 I need to append 2 String class variables using Struts 2 I tried like this <s:set var="Name" value="#variable1+#variable2"/> but no result. 回答1: Use OGNL to force evaluation of concatenation operation <s:set var="Name" value="%{#variable1 + #variable2}"/> 回答2: it is also working. <s:set var="Name" value="#variable1+''+#variable2"/> 来源: https://stackoverflow.com/questions/23789198/how-can-we-append-2-strings-in-struts

Migration path for a JDBC / struts / tomcat application

妖精的绣舞 提交于 2021-01-28 19:25:02
问题 I am working with a kinda large enterprise application which currently uses Struts 1.3 / JDBC and deployed on Tomcat 5.5. We predominantly use Struts Action only and do not use Action Forms or Struts tag libraries, only JSTL. We have a very thin DynaBeans based homegrown framework to provide very minimal light-weight, just-right-for-me resultset to object mapping. No JPA, No Hibernate, No EJB- just JDBC. This combination has served us well so far and we are quite happy the way we have been

window.opener用法

。_饼干妹妹 提交于 2020-12-26 07:56:12
在 JS 中,window. opener 只是对弹出窗口的母窗口的一个引用。比如: a.html中,通过点击按钮等方式window.open出一个新的窗口b.html。那么在b.html中,就可以通过window. opener (省略写为 opener )来引用a.html,包括a.html的document等对象,操作a.html的内容。 假如这个引用失败,那么将返回null。所以在调用 opener 的对象前,要先判断对象是否为null,否则会出现“对象为空或者不存在”的 JS 错误。 在一般的用法中,只是用来解决关闭窗口时不提示弹出窗口, 而对它更深层的了解一般比较少。其 实 window.opener是指调用window.open方法的窗口。 在工作中主要是用来解决部分提交的。这种跨页操作对工作是非常有帮助的。 如果你在主窗口打开了一个页面,并且希望主窗口刷新就用这个,打开页面的window.opener就相当于 主窗口的window。 主窗口的刷新你可以用 window.opener.location.reload(); 如果你用虚拟的目录:如struts的*.do会提示你重试 你可以改成这样 window.opener.yourformname.submit() 就好了 2〉 在应用中有这样一个情况, 在A窗口中打开B窗口,在B窗口中操作完以后关闭B窗口

Struts错误笔记

▼魔方 西西 提交于 2020-12-06 05:53:18
错误一 严重: Exception starting filter ServiceStruts2 java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector File: ContainerImpl.java Method: inject Line: 301 - com/opensymphony/xwork2/inject/ContainerImpl.java:301:-1 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:483) at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:193) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:278) at org.apache.catalina.core.ApplicationFilterConfig.getFilter

struts2学习笔记

那年仲夏 提交于 2020-11-25 04:10:45
对于只需在本Action内有效的Forward,应在Action元素内配置局部Forward. 能过ActionForm可使Action无须从HTTP请求中解析参数,因为所有的参数都被封装在ActionForm中。 ActionServlet拦截到用户的请求后,根据用户的请求,在配置文件中查找对应的Action,Action的name 属性指定了用于封装请求参数的ActionForm;然后ActionServlet将创建默认的ActionForm实例,并调用对应的setter方法完成ActionForm的初始化。 局部Forward作为Action的子元素配置,全局Forward配置在blobal-forwards元素里。 当每个Action在转发时,首先在局部Forward中查找与之对应的Forward对象,如果在局部Forward中找不到对应的Forward对象,才会在全局Forward中查找,局部Forward可以覆盖全局Forward. 表面上看起来,该Action的两个属性只提供了对应的setter和getter方法,很难理解请求参数在什么时候赋值给该Action的属性,事实上,因为Struts2的拦载器机制,它们负责解析用户的请求参数,并将请求参数赋值给Action对应的属性。 为了让Action能处理用户请求,还需要在struts.xml中配置一下,struts

What would be the flow order if I include multiple struts config file in the project

帅比萌擦擦* 提交于 2020-05-13 07:18:38
问题 I am using Struts2. Below is my Action Class ( TutorialAction ). public class TutorialAction { public String execute() { System.out.println("Hello from Execute!"); return "failure"; } } I am returning "failure" in execute method of this Action class. Below are my 2 struts config files : ======================== struts.xml ================================ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http:/

What would be the flow order if I include multiple struts config file in the project

痴心易碎 提交于 2020-05-13 07:17:08
问题 I am using Struts2. Below is my Action Class ( TutorialAction ). public class TutorialAction { public String execute() { System.out.println("Hello from Execute!"); return "failure"; } } I am returning "failure" in execute method of this Action class. Below are my 2 struts config files : ======================== struts.xml ================================ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http:/

What would be the flow order if I include multiple struts config file in the project

天大地大妈咪最大 提交于 2020-05-13 07:17:08
问题 I am using Struts2. Below is my Action Class ( TutorialAction ). public class TutorialAction { public String execute() { System.out.println("Hello from Execute!"); return "failure"; } } I am returning "failure" in execute method of this Action class. Below are my 2 struts config files : ======================== struts.xml ================================ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http:/