struts

Is it possible to use placeholder in context.xml

老子叫甜甜 提交于 2019-12-01 06:57:36
I'm using Spring and struts and have the following entry in '/META-INF/context.xml' <Context cachingAllowed="false" useHttpOnly="true"> <Resource name="jdbc/xxx" auth="Container" type="javax.sql.DataSource" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" maxActive="100" maxIdle="30" maxWait="10000" username="xxxxx" password="xxxxx" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://xxx:1433;databaseName=xxx;"/> </Context> Is it possible to implement in the following way, <Context cachingAllowed="false" useHttpOnly="true"> <Resource name="jdbc/xxx"

Is it possible to use placeholder in context.xml

感情迁移 提交于 2019-12-01 05:33:59
问题 I'm using Spring and struts and have the following entry in '/META-INF/context.xml' <Context cachingAllowed="false" useHttpOnly="true"> <Resource name="jdbc/xxx" auth="Container" type="javax.sql.DataSource" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" maxActive="100" maxIdle="30" maxWait="10000" username="xxxxx" password="xxxxx" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://xxx:1433;databaseName=xxx;"/> </Context> Is it possible to

Hibernate NoSuchFieldError INSTANCE but only with Struts 1?

混江龙づ霸主 提交于 2019-12-01 02:20:56
I'm new to Java and Hibernate (being a Rails and C# developer). Anyway, I have a test program that works fine with Hibernate but my actual web app (Struts 1) crashes with: SEVERE: Servlet.service() for servlet default threw exception java.lang.NoSuchFieldError: INSTANCE I am using: Hibernate 3.6.1 with Annotations Struts 1 with Apache Tiles C3P0 connection pool Here is the program that actually WORKS . It's a part of the main project. Just a simple JAVA test. public class TestUser { public static void main(String[] args) { SessionFactory factory = HibernateUtil.getSessionFactory(); Session

Controller in Struts

本秂侑毒 提交于 2019-12-01 00:39:06
问题 What is Controller in MVC ? Is it struts.xml or Servlet (Action Class)? Can we have more than one Controller in our application? Is it good practice to have more than one controller? 回答1: In Struts, application Controller layer code/functionality is split into two parts: ActionServlet with RequestHandler Action classes ActionServlet acts like FrontController pattern. Image from this OnJava article. 回答2: The ActionServlet is the controller IMO. In a broader scope the ActionServlet together

Is Struts 2 available as an OSGi bundle?

青春壹個敷衍的年華 提交于 2019-11-30 22:52:54
I have a server application that consists of multiple OSGi bundles, some mine, some third-party. One of the bundles provides a web frontend using Struts. The necessary Struts libraries live inside the web front-end bundle. Now I want to add a second bundle that provides another web front-end, with different dependencies and a very different use case. I want to use Struts for that bundle, too, but I don't want to put the same libraries into two bundles. With OSGi, it should be no problem to separate the Struts libs in a bundle of their own and use that from both my bundles. However, I couldn't

Hibernate NoSuchFieldError INSTANCE but only with Struts 1?

江枫思渺然 提交于 2019-11-30 21:52:42
问题 I'm new to Java and Hibernate (being a Rails and C# developer). Anyway, I have a test program that works fine with Hibernate but my actual web app (Struts 1) crashes with: SEVERE: Servlet.service() for servlet default threw exception java.lang.NoSuchFieldError: INSTANCE I am using: Hibernate 3.6.1 with Annotations Struts 1 with Apache Tiles C3P0 connection pool Here is the program that actually WORKS . It's a part of the main project. Just a simple JAVA test. public class TestUser { public

Using Hibernate session with quartz

安稳与你 提交于 2019-11-30 19:49:27
I've a web application which uses framework like Struts and Hibernate. Currently I'm developing a scheduler for this application using Quartz. While coding I realized that the use of Hibernate session is not possible with the threads of Quartz. Anybody have a solution for using hibernate sessions from quartz job class? One approach is to use a HibernateUtil class which builds the SessionFactory in a static initializer and makes it available via a public static getter. Your Quartz job can create a Session as HibernateUtil.getSessionFactory().getCurrentSession() and use it. I know this is an old

3.1 Struts2概述

人走茶凉 提交于 2019-11-30 18:54:28
Struts是一个基于MVC架构的框架。 3.1.1 MVC简介 包含三个基础部分:Model、Viev和Controller(上一章中JSP为View,Servlet为Controller,JavaBean为Model) MVC优点: 模型返回的数据与显示逻辑分离 应用被分成三层,降低了各层之间的耦合,提供了应用的可扩展性 控制层包含了用户请求权限的概念 MVC更符合软件工程化管理的精神 Struts2就是 兼容了Struts1和WebWork的MVC框架 。 3.1.2 Struts2的体系结构 Struts 2的基本流程如下: ① Web浏览器请求一个资源。 ② 过滤器Dispatcher 查找请求,确定适当的 Action 。 ③ 拦截器 自动对请求应用通用功能 ,如验证和文件上传等操作。 ④ Action的execute 方法通常用来存储和重新获得信息(通过数据库)。 ⑤ 结果被返回到浏览器。可能是HTML、图片、PDF或其他。 Struts 2框架的应用着重在控制上。 简单的流程是:页面→控制器→页面。最重要的是控制器的取数据与处理后传数据的问题。Struts 2的体系结构可以参考图3.1。 图3.1 Struts 2体系结构 附:目录 《JavaEE基础实用教程》笔记说明 来源: oschina 链接: https://my.oschina.net/u/220508

Spring security tags in sitemesh decorator

陌路散爱 提交于 2019-11-30 08:37:29
问题 I want to use a few tags of the spring security tag library inside the decorator file of site-mesh. However content inside these tags is never shown. Can anyone tell me why this is? Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <%@taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@taglib prefix="sec" uri="http://www.springframework.org

MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection

江枫思渺然 提交于 2019-11-30 08:14:01
问题 I built an web application and deployed locally working perfect. I deployed it on a remote server and started getting the : exception > javax.servlet.ServletException: could not execute query org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:518) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421) >root cause >org.hibernate.exception.JDBCConnectionException: could not execute query org.hibernate.exception.SQLStateConverter.convert