public class JVMAction implements ServletRequestAware { private ImportantInfo info;
private Map<String, String> environment; /** Captured only to show that undesired data can creep into the result. */
private HttpServletRequest servletRequest; public String execute() {
environment = System.getenv();
Properties props = System.getProperties(); String classpath = environment.get("CLASSPATH");
info = new ImportantInfo(classpath, props); return ActionSupport.SUCCESS;
} public HttpServletRequest getServletRequest() {
return servletRequest;
} public void setServletRequest(HttpServletRequest servletRequest) {
this.servletRequest = servletRequest;
} public Map<String, String> getEnvironment() {
return environment;
} public void setEnvironment(Map<String, String> environment) {
this.environment = environment;
} public ImportantInfo getInfo() {
return info;
} public void setInfo(ImportantInfo info) {
this.info = info;
} public class ImportantInfo {
private String classpath;
private Properties systemProperties; public ImportantInfo(String classpath, Properties properties) {
this.classpath = classpath;
this.systemProperties = properties;
} public String getClasspath() {
return classpath;
} public void setClasspath(String classpath) {
this.classpath = classpath;
} public Properties getSystemProperties() {
return systemProperties;
} public void setSystemProperties(Properties systemProperties) {
this.systemProperties = systemProperties;
}
}
}配置文件 <action name="jvmInfoRaw" class="com.brow.controler.JVMAction">
<result type="xslt">
<param name="exposedValue">info</param>
</result>
</action>jsp
<li><s:url var="url" namespace="/xslt" action="jvmInfoRaw" />
<s:a href="%{url}">Render the exposed portion of the action as xml</s:a></li>
private Map<String, String> environment; /** Captured only to show that undesired data can creep into the result. */
private HttpServletRequest servletRequest; public String execute() {
environment = System.getenv();
Properties props = System.getProperties(); String classpath = environment.get("CLASSPATH");
info = new ImportantInfo(classpath, props); return ActionSupport.SUCCESS;
} public HttpServletRequest getServletRequest() {
return servletRequest;
} public void setServletRequest(HttpServletRequest servletRequest) {
this.servletRequest = servletRequest;
} public Map<String, String> getEnvironment() {
return environment;
} public void setEnvironment(Map<String, String> environment) {
this.environment = environment;
} public ImportantInfo getInfo() {
return info;
} public void setInfo(ImportantInfo info) {
this.info = info;
} public class ImportantInfo {
private String classpath;
private Properties systemProperties; public ImportantInfo(String classpath, Properties properties) {
this.classpath = classpath;
this.systemProperties = properties;
} public String getClasspath() {
return classpath;
} public void setClasspath(String classpath) {
this.classpath = classpath;
} public Properties getSystemProperties() {
return systemProperties;
} public void setSystemProperties(Properties systemProperties) {
this.systemProperties = systemProperties;
}
}
}配置文件 <action name="jvmInfoRaw" class="com.brow.controler.JVMAction">
<result type="xslt">
<param name="exposedValue">info</param>
</result>
</action>jsp
<li><s:url var="url" namespace="/xslt" action="jvmInfoRaw" />
<s:a href="%{url}">Render the exposed portion of the action as xml</s:a></li>
解决方案 »
- log4j开源代码研究---如何打包
- 如何让方法中的变量信息显示在JSP中
- 又有麻烦了,自己都郁闷了,jsp问题
- 請問我這樣寫是不是有問題
- 请高手指照,有浏览器和tomcat的日志看错在哪里?(jsp+tomcat)
- 大家帮我看一下这段简单的代码,到底问题是出在什么地方了
- 通过servlet跳转到另一个jsp页面时,地址栏里怎么显示的还是servlet的地址?
- ”在线投票“,---有原代码,怎么总不成功!!急!!大家帮忙!
- 为什么很少有网站 采用 jsp 技术
- 无论如何,请大家帮帮我,天啊,7天了(路人甲,等你三天)
- sturts2表单重复提交 token does not match the session token null
- hibernate获取对象的对象用什么标签
javax.xml.transform.TransformerException: Operation not supported.
这个错误是 structs2.0.11与JDK之间的异常
但是我用的是2.3.1与2.3.4
XML用过多种方式 都是一模一样的 这个错误 晕死啊
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.postErrorToListener(TransformerImpl.java:772)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:715)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)
at org.apache.struts2.views.xslt.XSLTResult.execute(XSLTResult.java:404)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)