2
голосов
2ответов
1467 просмотров

Mapping both static and dynamic files in Tomcat/Spring?

I was using the following in web.xml to configure a servlet to dynamically generate PDFs. <servlet-mapping> <servlet-name>pdfServlet</servlet-name> <url-pattern>*.pdf</url-pattern> </servlet-mapping> Now, I also have to serve a few static PDF files. ...

0
голосов
1ответов
285 просмотров

creating spring bean

Is there a way to write a Spring bean in XML so that it uses constructor which doesn't need an argument. For instance: public class CronSchedule { public CronSchedule() throws Exception { SchedulerFactory sf = new StdSchedulerFactory(); Scheduler sched = sf.getScheduler(); ...

1
голосов
1ответов
941 просмотров

Strange Spring behavior on Jetty when spring.jar is in WEB-INF/lib/ instead of classpath

I'm running Eclipse with the run-jetty-run plugin to launch my J2EE web apps. My project uses Spring, and the spring configuration uses things like HttpInvokerProxy and properties placeholder. When the spring jars are on the classpath (I mean configured in the "classpath" tab of the "run config...

5
голосов
3ответов
38515 просмотров

Relative paths in spring classpath resource

I have a bunch of spring config files, all of which live under the META-INF directory in various subpackages. I have been using import like the following... <import resource="../database/schema.xml"/> So a relative path from the source file. This works fine when I am working with a l...

30
голосов
4ответов
19783 просмотров

Spring syntax for setting a Class object?

Is there a way to set a property in spring to, not an instance of a class, but the class object itself? i.e. Rather than <bean> <property name="prototype" class="a.b.c.Foo">... giving you an instance of "Foo", something like: <bean> <property name="prototype" class...

4
голосов
1ответов
2082 просмотров

Accessing jax-rs (CXF) MessageContext outside service class in Spring (2.5)

I'm trying to access the MessageContext (or WebServiceContext) in an aspect to get access to the HTTPServletRequest for logging purposes. I would like to inject the context like I did for spring-ws but I have not found a way to do it. Here is what I used for spring-ws: <beans:bean id="transpo...

4
голосов
1ответов
3870 просмотров

Spring's PropertyPlaceholderConfigurer with property in a jar file

I have multiple property files I need to refer to. Below I can refer to two that are on the classpath. How do I refer to a property file with in a jar file ? <bean id="placeholderConfig" name="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer...

1
голосов
1ответов
1319 просмотров

Dereferencing Aliases in LDAP using Spring

How to control LDAP Alias Dereferencing Mode using Java and Spring LDAP API? Similarly to how it is done using ldapsearch on linux. Example: ldapsearch -a never "(&(o=foo)(cn=bar))" cn ldapsearch -a always "(&(o=foo)(cn=bar))" cn

14
голосов
6ответов
49356 просмотров

Reading a list from a file .properties using Spring properties place holder

I want to fill a bean list property using Spring properties place holder. Context file <bean name="XXX" class="XX.YY.Z"> <property name="urlList"> <value>${prop.list}</value> </property> </bean> Properties File prop.list.one=foo pr...

2
голосов
3ответов
1390 просмотров

How to implement Abstract Factory pattern in Spring-AOP?

Is implementing the Abstract Factory pattern for a spring-based project with AOP should be any different than in a normal project?

2
голосов
1ответов
260 просмотров

Is there a Spring HandlerAdapter implementation for Struts?

This is just a curiosity question. I know that Spring can be used in a Struts ActionServlet (sp?) via certain means, but I was wondering if there was a HandlerAdapter that allowed old Struts code to be ported immediately to a Spring DispatcherServlet to use the DispatcherServlet as the front con...

0
голосов
2ответов
3264 просмотров

java generics type parameters and operations on those types

In searching for an answer to an interesting situation which I had recently encountered I came upon the following question: Type safety, Java generics and querying I have written the following class (cleaned up a bit) public abstract class BaseDaoImpl<T extends Serializable> extends Hiber...

1
голосов
2ответов
1989 просмотров

JdbcTemplate batch update in postgresql - date loses time?

I am inserting a list of object with java.util.date in format YYYY-MM-DDThh:mm:ssTZD (2008-09-26T14:34:59+02:00). SQL: INSERT INTO cdate (key,valuedate,user_id) VALUES(?,?,?) BatchPreparedStatementSetter bpss = new MetaJdbc().setMetaBatchPreparedStatement( list, userI...

1
голосов
2ответов
1888 просмотров

Faces conversion service is not found for converting 'dataModel'

While creating my first swf application with JSF integration, I get the following error : Unable to load class 'dataModel' when parsing my flow definition on the first request. It appears that the FacesConversionService (the class that understands the 'dataModel' alias) is not invoked while tryi...

4
голосов
2ответов
2142 просмотров

Out of Memory Error in Eclipse

I am trying to install Spring framework in my eclipse ganymede through an update site http://springide.org/updatesite. But when it updates an error will occur in my ide which says that an out of memory error occurred.

3
голосов
2ответов
3618 просмотров

Creating temporary JMS jms topic in Spring

I'm trying to refactor some legacy code to use Spring to handle the jms connections to a mainframe service. I need to connect create a temporary topic for the mainframe service reply and set that as the message.setJMSReplyTo(replyTo); in the message before I send the message. Can anyone provide ...

1
голосов
1ответов
654 просмотров

Servlet "newspring" is not available

Trying to set up a new spring project and im having this issue where I get this error (HTTP Status 404 - Servlet newspring is not available) when I navigate to a page that I expect to get routed through to a controller. web.xml <servlet> <servlet-name>springapp</servlet-name&gt...

3
голосов
2ответов
8624 просмотров

Validate request headers with Spring validation framework

Is it possible to use the Spring validation framework with Spring MVC to validate the presence and value of an HTTP request header?

1
голосов
3ответов
770 просмотров

Mail for Blackberry's - multiple content attachments

We'd like to send a single email which has "multiple contents" attached. Scenario is that we'd like one content to be displayed if the email is read using a Blackberry and another content displayed if the email is read in a desktop email client. (Blackberry content would be just text, other dev...

2
голосов
1ответов
1366 просмотров

Inheritance and subflows with Spring WebFlow in grails

Spring WebFlow supports some advanced reuse features like flow inheritance and subflows. Using this features in SWF xml definitions is pretty easy, for example: <flow parent="parent"> <subflow-state id="addGuest" subflow="createGuest"> Can I use these features with weblflows in Gra...

3
голосов
2ответов
376 просмотров

caching spring/hibernate webapp

I have a website that allows searches for lists of content in various ways, for instance "show stuff created by user 523 ordered by date" or "show a list of the most recent 10 posts." I use Hibernate for my ORM, and Hibernate provides a cache for objects. For lists of objects, though, like the ...

5
голосов
2ответов
6771 просмотров

Spring @Transactional merge and persist question

new to Spring and here @stackoverflow I'm building an stand-alone Inventory & Sales tracking app (Apache Pivot/Spring/JPA/Hibernate/MySQL) for a distributor business. So far I think everything is CRUD, so I plan to have a base class with everything @Transactional. Then I got a problem with...

3
голосов
1ответов
3208 просмотров

weird grails error message

Using grails 1.1.1 I got this message when I did a modification on a service and then tried to refresh the page. I have a controller name ContributionPlanController. It has a service ContributionPlanservice. inside the ContributionPlanService, it has ProductService and some other Services incl...

4
голосов
1ответов
1375 просмотров

How can I access path variables in a URI template in the view (Spring 3/SpringMVC)?

I have a URI template in the form of "/hotels/{hotel}/bookings/{booking}", and can access the path variables in the controller via @PathVariable, but when building links in the view I need a reference to the different path variables. As an example, let's say the user requests "/hotels/123/book...

2
голосов
2ответов
2423 просмотров

Loading Spring Context Dynamically at Run-time in a Web Application

I'm converting a standard Java Application that uses Spring Framework into a Web App. This application loads new Spring Context based on run-time parameters, that was done using ClassPathXmlApplicationContext/FileSystemXmlApplicationContext. So my question is how to do the same in a Web Applica...

15
голосов
4ответов
16524 просмотров

Spring Explorer not showing beans from bean definition file

I just downloaded the Springsource Tool Suite, and I created a simple bean configuration file called myDefinition.xml and placed it in the root directory of the Spring Project. However, the Spring Explorer is not showing any data. I'm using eclipse 3.5 and the latest SpringSource all-in-one insta...

2
голосов
2ответов
338 просмотров

Two EntityManagerFactories

I want to have two EntityManagerFactories (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean in this case), with each of them having their own data source and own set of persistent objects. So somehow I need to be able to scope entities to a particular entity manager factory. I ...

5
голосов
2ответов
1929 просмотров

Spring Application Context available inside the constructor

I am having an issue when trying to create beans from a spring Application Context inside a bean instantiated by spring using constructor arguments. I have implemented the ApplicationContextAware interface but it populates the context after the instance is created (obvious). But then, if you n...

3
голосов
2ответов
4205 просмотров

SOAP and Spring

I've just finished reading about SOAP via Spring-WS in "Spring in Action", 2nd edition, by Craig Walls from Manning Publications Co. They write about Contract First, much like the Spring docs, with making a message and method XML and then transforming that to XSD and then again to WSDL, while wir...

2
голосов
2ответов
2511 просмотров

Getting error when submitting form using SpringMVC and REST

Created an online form in JSP using SpringMVC tag libraries. The controller for my form is a RESTful web service. The RESTful web service has two calls: (1) http://localhost:8080/myapp/applications/new This brings up the online form in the browser (this works). (2) http://localhost:8080/myap...