struts

吴裕雄--天生自然轻量级JAVA EE企业应用开发Struts2Sping4Hibernate整合开发学习笔记:配置Action(2)

こ雲淡風輕ζ 提交于 2020-02-25 22:52:23
<?xml version="1.0" encoding="GBK"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <package name="lee" extends="struts-default"> <!-- 使用模式字符串定义Action的name,指定所有以Action结尾的请求, 都可用LoginRegistAction来处理,method属性使用{1}, 这个{1}代表进行模式匹配时第一个*所代替的字符串 --> <action name="*Action" class="org.crazyit.app.action.LoginRegistAction" method="{1}"> <!-- 定义逻辑视图和物理视图之间的映射关系 --> <result name="error">/WEB-INF/content/error.jsp</result> <result>/WEB-INF/content/welcome.jsp</result> </action> <action name="*"> <result>/WEB

Struts The absolute uri: http://struts.apache.org/tags-bean cannot be resolved in either web.xml or the jar files deployed with this application

十年热恋 提交于 2020-02-16 08:49:34
问题 Using Servlet 3.0, Maven 4.0, JDK 8 with compliance 1.8. I don't know if the problem is due to eclipse not being able to build the project against the libraries correctly, or if it's tomcat. It may be a permission issue, despite the fact that i'm running both tomcat and eclipse as root, but who knows. At this point i'm starting to run out of ideas. Libs Imported The index.jsp <%@ page language="java" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http:

Remove .action extension in struts1 and to give user defined extension

倖福魔咒の 提交于 2020-02-06 15:04:32
问题 our application has developed in struts 1 , all action class has .action as extension, My action URL is Action URL: http://localhost:8089/Struts2/Login.action when i submit the action for this url , I want change the URL to "http://localhost:8089/Struts2/Login" or can i give any user defined name instead of .action 来源: https://stackoverflow.com/questions/58553020/remove-action-extension-in-struts1-and-to-give-user-defined-extension

Remove .action extension in struts1 and to give user defined extension

浪子不回头ぞ 提交于 2020-02-06 15:03:47
问题 our application has developed in struts 1 , all action class has .action as extension, My action URL is Action URL: http://localhost:8089/Struts2/Login.action when i submit the action for this url , I want change the URL to "http://localhost:8089/Struts2/Login" or can i give any user defined name instead of .action 来源: https://stackoverflow.com/questions/58553020/remove-action-extension-in-struts1-and-to-give-user-defined-extension

Variable in an attribute in Struts custom tag

a 夏天 提交于 2020-01-25 12:34:04
问题 I am trying to use a variable inside a custom Struts tag something like follows - for(String currentMacro : (List<String>)(request.getAttribute("individualMacros"))) { name = currentMacro.<some-operation> <html:mce name = "hmtl_<%= name %>" /> Something like this. But <%=name%> is not replaced with the variable value. It works when I am using the variable with a pure HTML tags. Is there any any way to accomplish this in this case? Thanks. 回答1: Use JSP EL (assuming JSP 2.0, and you put "name"

struts2 logs disabling from log4j.properties file

試著忘記壹切 提交于 2020-01-25 08:28:19
问题 I'm migrating from struts1 to struts2, i'm facing problems with logs which are continously logging with debug level Below are the logs which i took it from log file DEBUG 15287 [freemark] (): Key "errorposition" was not found on instance of java.util.LinkedHashMap. Introspection information for the class is: {getClass=public final native java.lang.Class java.lang.Object.getClass(), java.lang.Object@3c9557f1=freemarker.ext.beans.OverloadedMethods@174dae2d, clone=public java.lang.Object java

Struts底层工作原理

自古美人都是妖i 提交于 2020-01-20 04:44:32
4)从Taglib的角度论述Struts项目到底是如何工作的?(初学者可以略过) 上 面我们在讲:taglib推出以后的巨大变革中,讲到:你在jsp中引入他们的一个标签儿,再按照他们的语法配置,被你引入的那个标签儿,就能够调用你编 写的类。下面我们就给出一个例子来说明这件事是怎么实现的。底下例子中的struts.tld和 com.struts.GetDataFromDB.java,这两个文件都是struts这个架构公司编的。它把这两个文件,打包在一个jar包里,发 布出来。各路世界的工程师到它的网站下载下来,导到自己的项目当中。比如在我自己的项目中,我编写了一个index.jsp,其中我引用了struts公 司的一个标签,struts:getDataFromDB,这个标签的两个属性className和methodName规定了,只要你把自己写的类名和 方法名写在这里,这个标签就能调用你的类里的方法。还规定你的这个方法返回的,一定是从数据库获得的一个字符串。之后它这个标签儿就能把你的这个返回的字 符串显示在网页上。总体算一下,从数据库当中取回字符串显示在网页当中,整个这件事,我们只编写了自己的一个类 com.myself.GetDataFromDB,而且完全是按照我们自己的意志,访问的数据库。因为这个类完全是我们自己编写的。大部分的代码tld 文件和com.struts

How to Convert Struts tags into Spring 4.0?

a 夏天 提交于 2020-01-16 19:31:07
问题 I have some custom code using Struts library which we are porting to Spring MVC I need to replace SkinTagUtils.findInScope("value1",pageContext) and SkinTagUtils.putToScope("key", key, "page", pageContext) lines into Spring or JSP.. 回答1: If you have pageContext object then you can use it to find a variable in the scopes. pageContext.findAttribute("value1"); or set it to the page scope pageContext.setAttribute("key", key); Note, there's also other convenient methods of JspContext to retrieve

how to dynamically download a file using struts 2 annotations (passing variable into annotation)

扶醉桌前 提交于 2020-01-16 19:07:02
问题 im new to struts 2 and im asking if there's a way to pass a variable argument into struts 2 annotation. here is what i already did but with no luck public class DownloadFileAction extends ModuleGenericClass{ private InputStream inputStream; private String fileName; @Action(value="/downloadFile",results={ @Result(name="success",type="stream",params = { "contentType", "application/octet-stream", "inputName","inputStream", "bufferSize","1024","contentDisposition", "filename=\"${fileName}\""}) })

how to dynamically download a file using struts 2 annotations (passing variable into annotation)

落花浮王杯 提交于 2020-01-16 19:05:51
问题 im new to struts 2 and im asking if there's a way to pass a variable argument into struts 2 annotation. here is what i already did but with no luck public class DownloadFileAction extends ModuleGenericClass{ private InputStream inputStream; private String fileName; @Action(value="/downloadFile",results={ @Result(name="success",type="stream",params = { "contentType", "application/octet-stream", "inputName","inputStream", "bufferSize","1024","contentDisposition", "filename=\"${fileName}\""}) })