spring

spring wiring, singleton versus prototype

just reading up on spring, and when using DI in spring, if you set the bean to be a singleton (default), then a single instance of the class will be 'dispensed', while prototype forces a new instance each time. What are the ramifications of having the same instance dispensed by the container each time? does that mean there will be share...

JPA's context injection

I'm trying to use JPA's Context Injection. Currently my code fails to have the context injected, throwing a NullPointerException: Exception in thread "main" java.lang.NullPointerException at learn.spring.dao.ListingDao.findById(ListingDao.java:19) Below is my code, anyone see what is wrong/missing? Thanks. Spring Configuration...

building a high scale java app, what stack would you use?

if you needed to build a highly scalable web application using java, what framework would you use and why? I'm just reading thinking-in-java, head first servlets and manning's spring framework boo, but really I want to focus on highly scalable architectures etc. would you use tomcat, hibernate, ehcache? (just assume you have to design...

would you use AOP to track points?

would you use springs AOP (aspects) if you had to track user points throughout your application? it seems like a potential fit, since points are awarded etc. throughout the application, kind of like security checks. (just reading on AOP, trying to grasp its potential and usage other than say security or logging). when you wire up your...

Annotation-based and xml-based transaction definitions precedence

I couldn't find a definitive answer to this in the docs, and although there seems to be a logical answer, one can't be sure. The scenario is this - you have a xml-based transaction definition, like: <tx:advice id="txAdvice" transaction-manager="jpaTransactionManager"> <tx:attributes> <tx:method name="*" propagation="REQUIRED...

struts2 portlet with spring on liferay problem

i tried to integrate struts2 portlet with spring into liferay portlet container but i failed to create action of struts with spring first i use struts 2 spring plugin and create the action into spring config file like <bean id="helloStruts2Portlet2" class="com.portlet.struts.HelloStruts2Portlet"><property name="title" value="Software E...

Google App Engine (Java) + Spring managed PersistenceManager

Hi, I've got kinda problem with JDO persistence of a list of just retrieved objects. What I want to do is to: Fetch list of "Orders" Modify one property "status" Make bulk update of "Orders" What I've got so far is "Object with id ... is managed by a different Object Manager". But wait, I haven't faced such a problem without Spring...

does spring provide 2 mvc platforms, grails and spring mvc?

Just reading spring in action, and I know there is a chapter on MVC that I havent' got to yet. I also read about grails, is that another framework or built on top of spring? ...

spring security, can you add granular levels of security?

With spring security, could you add permissions for a user like: canEditPage canViewPage canLogin etc? if yes, Are these stored at a byte array interally? ...

enterprise with jdbc

I have enterprise project, but all queries are implemented using oracle stored procedures, I use jbdc and Spring framework to get results like this : public class HoaDonDAOimpl extends JdbcDaoSupport implements HoaDonDAO { public List<HoaDon> getDsTatcaHoadonPhathanh(int vthang, int vnam, String vmaDvqltb) throws Exception { Ca...

Can't I use annotation to indicate a bean is a primary bean

We know in Spring, <bean> has an attribute "primary" to indicate a bean is the first candidate if there are multiple beans are available to be autowired to a property. But now all my bean definition are declared using @Component/@Service, etc, I can't find the corresponding "primary" attribute I can use to declare a bean. Please advis...

Why do we need to specify class inside <persistence-unit> element?

My persistence.xml has 2 persistence-units. Each of them has several <class> elements. I thought that we must specify all classes related to certain persistence-unit. But I accidentally forgot to specify class-element for new entity but the program worked fine even without it. Then I removed all class-elements and everything worked fine...

creating an installer for a java spring mvc app

any good tutorials on creating an installer that will install a spring mvc web application, namely setting up tomcat and postgresql on someones desktop? ...

Spring framework IDE - where to learn efficently?

Hi there, im looking at spring right now and im not sure how to use it in most efficent way as im not sure if it does not have some features or do i need some special way to enable them. Question: What resources would you recommend to pick up quickly the tools necessary for quick and easy java jsf/spring development? Some of the proble...

BlazeDS : what ARE those standard security fault codes ?

Hi, I'm trying to write a Flex client that interacts with a Spring-Flex java application. I would like to catch (the flex equivalent of) SecurityExceptions and Display an error page if the user was trying to do something they aren't allowed to do Pop up a login box if the user wasn't logged in According to the Spring-Flex docs, ...

does spring framework mvc replace struts? or am I confused?

is struts (1 or 2?) used strictly for MVC type architecture or is there more to it? reason I am asking is I am looking at a web application and they seem to be using both spring and struts. ...

Spring Hello World setup and code in eclipse

I have setup Spring / WTP in eclipse as well as successfully started a Tomcat 6 server within eclipse. I'm at the point where I can create a new Spring project and add source files as necessary. Could somebody please describe (or point me to) how I can setup of some sort of 'Hello World' test and how to run it? I have experience devel...

spring mvc servlet initialization

Hi, I am new to spring MVC. I am looking for a place in my spring mvc applicationwhere I can initialize all sorts of things in the application. usually I did that in the init() method of the my main servlet but now the dispatcher servlet is of spring and I cannot overide the init function. what is the best practice? Thanks. ...

Loading Constants from db and reading them in an include file

I have a list of constant values which are stored in a database table. My application's search form is generated by a common include file which can be placed in any JSP page on the site. This search form should include the constants from the database table. A Spring bean manages the database layer and I'm having trouble finding an approp...

UnexpectedRollbackException - a full scenario analysis

All I know about this exception is from Spring's documentation and some forum posts with frostrated developers pasting huge stack traces, and no replies. From Spring's documentation: Thrown when an attempt to commit a transaction resulted in an unexpected rollback I want to understand once and for all Exactly what causes it? ...