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...
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...
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 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...
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...
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...
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...
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?
...
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?
...
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...
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...
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...
any good tutorials on creating an installer that will install a spring mvc web application, namely setting up tomcat and postgresql on someones desktop?
...
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...
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,
...
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.
...
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...
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.
...
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...
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?
...