I have next working code:
Session session = null;
try {
SessionFactory sessionFactory = new Configuration().configure()
.buildSessionFactory();
session = sessionFactory.openSession();
String id = (String) FacesContext.getCurrentInstance()
.getExternalContext().getRequestParameterMap().get(
"storeId");
Transac...
I have an object with two parameters that needs to be created via Spring.NET using the configuration file for decoupling.
public Object(string param1, string param2) { ... }
The two parameters are dynamically passed in based on user interaction where they pass in a username and password, so these values can't be hard coded to the conf...
Hello all I have a simple Spring application which will not end as there is still a reference left to org.enhydra.jdbc.pool.PoolKeeper. I include all the references I feel are revelant below does it look ok and has anyone experienced this before?
I ran jstack to see what non daemon threads where running and found the following.
"Threa...
I have chosen to go the JEE route for a career path but I have been having a hard time determining which core technologies that I need to be most familiar with. I'm at the point I can write web apps without a problem with JSP's and regular servlets using JDBC or some basic Hibernate stuff (I know, HTML, CSS and have used MVC extensively ...
For example, in a Spring config I have a map like this-
<util:map id="someMap"
map-class="java.util.HashMap"
key-type="java.lang.String"
value-type="java.lang.String" >
<entry key="A" value="Apple" />
<entry key="B" value="Banana" />
<entry key="C" value="Cherry" />
<entry key="D" value="Durian" />
<...
Is there a way in Spring that I can auto populate a list with all of beans of a type AND any of its subtypes? I have a setter method that looks like:
setMyProp(List<MyType> list)
And I would like to autowire in any beans of MyType and all subclasses of MyType.
Thanks,
Jeff
...
Hi,
I am new to Spring framework. I was recently part of a Task where an estimation for a Spring/Hibernate based web application was being prepared. We had Functional & Business requirements and detailed Use Cases. I was asked to prepare a list of the inventory or Work Item types (Controllers, Entities, DAOs, ServiceClasses, Application...
Hi all,
Trying to integrate Spring 2.5.5 with Xfire 1.2.6, I'm attempting to inject one of my beans into my service but it's failing on initialisation with the following exception:
java.lang.NoSuchMethodError: <init>
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:420)
at org.spr...
In spring I often find myself utilizing the init-method & destroy-method attributes on beans. I'm curious about the contract of these methods. The init-method attribute seems to be called post construction and after all properties have been set. My question is if destroy-method has the same contract. If a setter throws for whatever r...
Given an application using Spring 2.5, when migrating to Spring 3.0 what are the likely areas that will be pain points, i.e. things that the development team will have to spend time on to get things working. Assume the team would not try to take advantage of new Spring features as part of the upgrade, but just get the application to the ...
Hi,
I have an issue trying to delete using hibernate. When I try to delete I get an exception saying that children exist and there is a FK violation. I want to delete the children also but the delete doesn't seem to be cascading. After about a week of trying to fix this issue I read that I should be using HibernateInterceptor to keep...
How do I move my spring xml configuration outside of my java web application?
I'd like to store my spring.xml outside of my web application so I don't have to create a new build of my application to change the configuration.
What is the best way to do this?
...
I was just reading an article that showed the following Spring Security XML configuration:
<authentication-provider>
<password-encoder hash="sha" />
<jdbc-user-service data-source-ref="dataSource" />
</authentication-provider>
I wondered if password-encoder could take some combination of parameters that would make it use SHA...
Hello,
I have numerous Spring Framework-based applications that run on a Tomcat 5.5 server. Some of them have their own instances, some share a server with other applications. The one thing they all have in common is that they require huge amounts of memory, more than I think they should really require. Are there any tools out there ...
I have a multi-threaded, multi-server web application with hibernate and spring managing transactions with AOP. The problem is, I need to maintain in-memory data and keep it current with the state of the database...essentially I'm implementing an in-memory cache.
Now, is there any way to make my in-memory pojos transactional on the same...
Hi,
In Struts, you can confire a global prefix and suffix in a resource bundle file. Something like:
errors.prefix=<div class="error">
errors.suffix=</div>
So <div class="error"> will be added before each <html:errors and </div> will be added after each one.
So how can i get the same effect by using Spring form tags <form:errors ?
...
In web.xml I have the following:
<servlet>
<description>JAX-WS endpoint - EARM</description>
<display-name>jaxws-servlet</display-name>
<servlet-name>jaxws-servlet</servlet-name>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSSpringServlet</servlet-class>
</servlet>
<servlet-mapping>
...
I'm building a new web application that uses Linux, Apache, Tomcat, Wicket, JPA/Hibernate, and MySQL. My primary need is Dependency Injection, which both Spring and Guice can do well. I think I need transaction support that would come with Spring and JTA but I'm not sure.
The site will probably have about 20 pages and I'm not expect hug...
Hi,
I have a form
<form:form commandName="command" method="post">
<form:errors path="property"/>
// some fields
</form:form>
And a MultiActionController
Command command = new Command();
ServletRequestDataBinder binder = createBinder(request, command);
binder.bind(request);
for (Validator validator: getValidators())
if...
Hi guys,
When I use DispatcherServlet, I get a java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
error when I use a DelegatingFilterProxy filter. Therefore I've removed the DispatcherServlet and now I use a ContextLoaderListener instead, and my Spring application loads fine. However, ...