spring

Performance impact of using aop

We have started to use spring aop for cross cutting aspects of our application (security & caching at the moment). My manager worries about the performance impact of this technology although he fully understands the benefits. My question, did you encounter performance problems introduced by the use of aop (specifically spring aop)? ...

Spring context.xml and Set.contains()

Spring: In my context.xml, I have: <util:set id="someIDs" set-class="java.util.HashSet" value-type="java.lang.String"> <value>"W000000001"</value> <value>"W000000003"</value> <value>"W000000009"</value> </util:set> In my Java bean, the implementation is: private Set<String> someSet = ComUtiliti...

How to use CurrentSessionContext/SpringSessionContext along with HibernateDaoSupport to intercept calls to getCurrentSession()

I'm using HibernateDaoSupport in Spring for Spring-Hibernate integration. I need to intercept all getCurrentSession calls and enable a filter and set a filter parameter value. Hibernate supports CurrentSessionContext impls to intercept getCurrentSession calls. Spring provides an implementation of this called SpringSessionContext. But wh...

Maven install folder structure problem j2ee (spring, struts ..)

Hi i'm using maven 2.1-SNAPSHOT as eclipse plugin. My project structure is like this: src/main/java    -model    -service    -action src/test/java    empty atm src/main/resources    empty atm src/test/resources    empty atm src/main/webapp    -js     -dojo    -META-INF    -WEB-INF      web.xml      appcontext.xml    ...

Spring dependency injection or aspect programming

I have a need for methods in several classes that must always follow a specific pre and post pattern. public void method(X x, Y y ) { // ********Repeating Part begin **************/ AFrameworkClass aFrameworkClass = new AFrameworkClass (this.memberVariable,"SomeString"); try { aFrameworkClass.aFrameworkMethod( x,y); aFrame...

Do you think the Spring WebFlow Flow Definition format would be suitable for externalising a Web Flow for a non Spring framework?

I like the idea of Spring WebFlow - particularly the way the flow definitiion abstracts the higher level web flow from components in the Spring Bean Container. The Flow definition format seems to include everything one needs in a Web Flow - views, actions, transitions, subflows, outcomes etc. Do you think the Spring WebFlow Flow Defin...

LazyInitializationException even though openSessionInViewInterceptor

Hello! I have a problem with LazyInitializationException even though I'm using openSessionInViewInterceptor. I've read so many posts about that topic and I've tried three or four different approaches to it. First thing is that I don't want to set to false the lazzy attribute in the Hibernate configuration file. So, I want an actual solu...

Spring MVC tag interaction with custom tag

I have a JSP that is using Spring:form tags to bind controls to a command object. I would like to modify it as follows: if [some condition is true] than display the controls; otherwise, just display the text. (Examples: if the user is an Admin, display the controls, otherwise just display the text. If the whatsit is still open for modi...

Java Web Service framework/library, which is a better one and why ?

Currently I am evaluating number of web service frameworks in Java. I need web service framework that will help me to expose some functionality of existent application running on JBoss, The application is mostly developed using Spring and POJOs (no EJBs). What I need is a framework having following properties: It should provide tools ...

How do I force a spring container not to return a singleton instance of a bean?

When I call getBean(name) on a BeanFactory, I get back an instance of the bean defined in the application context. However, when I call getBean(name) again (with the same name,) I get the same instance of the bean back. I understand how this would be desirable in some (many?) cases, but how do I tell the BeanFactory to give me a new in...

Loading an object in ServletContext (application scope)

I would like to put two small constant objects (one TreeMap and one ArrayList) somewhere in the ServletContext of a Struts2 webapp (running under Tomcat 6), such that those objects may be accessible from any JSP, through the Application Scope. Under Struts1, I would have used one of those startup "plug-ins" (defined in struts-config.xml...

What do I need to offset the performance setback induced by use of the Spring framework?

I am using Spring with Hibernate to create an Enterprise application. Now, due to the abstractions given by the framework to the underlying J2EE architecture, there is obviously going to be a runtime performance hit on my app. What I need to know is a set of factors that I need to consider to make a decision about the minimum specs(Pr...

What caching model/framework with Websphere Spring Hibernate Oracle?

We are looking at implementing a caching framework for our application to help improve the overall performance of our site. We are running on Websphere 6.1, Spring, Hibernate and Oracle. The focus currently is on the static data or data that changes very little through out the day but is used a lot. So any info would be great. I ha...

Custom spring scopes ?

Anyone know of any other custom spring scopes than Servlet Context Scope and ThreadScope ? If you've made some closed-source custom scope I'd really also be interested in hearing what it does and how it worked out for you. (I'd imagine someone would make a WindowScope in a desktop app ?) I'm open to all use cases, I'm looking to expan...

LInqToSql and errors when a debugger is attached

I am using LinqToSQL to grab data from my database. I am injecting my DBContext into the application using Springs IOC container. If I dont have my VS debugger attached, it works fine. However, with the debugger attached I get the following errors: "There is already an open DataReader associated with this Command which must be closed...

How can I determine what roles are required to access a URL with Spring Security?

I'm using Spring Security to secure a webapp. The URLs are secured like this: <security:http entry-point-ref="authenticationEntryPoint"> <security:intercept-url pattern="/" access="ROLE_ANONYMOUS" /> <security:intercept-url pattern="/assets/**/*" access="ROLE_ANONYMOUS" /> ... <security:intercept-url pattern="/**" access="ROLE_U...

Spring - Annotation Based Controller - RequestMapping based on query string

In Spring annotation-based controller, is it possible to map different query strings using RequestMapping to different methods. for example @RequestMapping("/test.html?day=monday") public void writeMonday() { } @RequestMapping("/test.html?day=tuesday") public void writeTuesday() { } Thanks. ...

Pointcut not working with Spring AOP

In order to implement Logging using Spring AOP I followed these simple steps. But it seems like its not working. Any help would be useful 1) Created MyLoggingAspect class import org.aspectj.lang.ProceedingJoinPoint; public class MyLoggingAspect { public MyLoggingAspect() { super(); System.out.println("Instantiated M...

websphere portal 6.1 development - which web framework to use?

I am starting a portal project using websphere portal server 6.1. This involves lot of portlets and i am inclined to use JSR286 specs rather than JSR168 Also, i wanted to use Spring Portlet MVC but 3.0 release is still in M2 and does not have proper documentation for the new features added. Should i start using Spring v2.5.6 and later ...

Spring constructor params?

Some of my classes have final fields that are populated from the constructor as well as properties that can be assigned from getters and setters. If I can do this using spring, what does the springcontext.xml file look like that creates objects in this way? Thank you ...