spring

Having Multiple forms on spring MVC

Hi All, I have this question about Spring MVC 2.5. Oftentimes, I am only using one form in all my JSP. Now I need to add another form into the same JSP. My question is, will spring mvc still support the same lifecycle method whichever form I submit? I mean, the same databinding, validation, errorhandling, form controller etc? <div>...

Grails dependency issues

I'm in the process of moving a Java/Spring MVC app to Grails. I was able to get a couple of pages along with Spring Security working. However, when I added cxf-bundle-minimal as a dependency I started to get the errors below. :::::::::::::::::::::::::::::::::::::::::::::: :: UNRESOLVED DEPENDENCIES :: :::...

Why request.getRemoteAddr() returns ipv4 or ipv6 depending on context (post query or ajax query)

Hello, I've donne a web app with Spring/GWT that uses Flash to upload files. When I send an ajax request with GWT and try to get the user ip address, I get an ipv4 address like: 127.0.0.1 but when I upload my files with flash (and so a post request on the same webapp) I get an ipv6 address 0:0:0:0:0:0:0:1 I use the same code to get ...

Is it possible to obtain the Request Object in a request scoped bean?

I have a bean declared to be scope="request". is there a chance to obtain the request being used in that scope? <bean class="FooRequestAware" scope="request"/> class FooRequestAware { private final Request req; public final bar() {} } ...

Help need to get spring mvc going with IntelliJ

So I downloaded a trial of idea ultimate, and I want to get spring mvc going with tomcat. So I setup a new project, configured it to use sun jdk. I chose a spring application, and it created and downloaded the following: I don't see any spring-mvc libraries, are they included in there or do I have to do something about that? Can so...

How to modify Struts2 start up process.

I need to modify the web start up service to query some database objects and put it into the session when the server(JBOSS 5) starts. Any idea what is the best way to do it? I am using struts2.1.6 + spring 2.5.6 + JPA + Hibernate. Thanks. ...

Where should I put @Transactional annotation: at an interface definition or at an implementing class?

The question from the title in code: @Transactional (readonly = true) public interface FooService { void doSmth (); } public class FooServiceImpl implements FooService { ... } vs public interface FooService { void doSmth (); } @Transactional (readonly = true) public class FooServiceImpl implements FooService { ... } ...

Why can't I use Spring:url in an href?

I have seen several examples using <a href="<spring:url value='/about/' />" >About </a> I try this and get an error from Jetty Caused by: org.apache.jasper.JasperException: /WEB-INF/views/footer.jspx(6,22) The value of attribute "href" associated with an element type "null" must not contain the '<' character. Is there some encodi...

How do I extract the request URL to the views using Spring Roo?

I am using spring roo. I am not able to find a method to extract the request URL from the browser in the template. eg: http://localhost:8080/mysite/about/advisors . I want to extract advisors from it. I tried using ${pageContext.request.requestUri} but it returns the url like default.jspx. Please tell me how to do it? ...

when setting up a web app in IDEA, can someone help me with Facets/Modules and Artifacts.

using IDEA ultimate, how would I start a project and have the following layout: /src/ /src/main/java/com/example/myapp /src/main/resources /src/main/webapp /src/main/webapp/META-INF /src/main/webapp/WEB-INF /src/main/webapp/WEB-INF/jsp /src/main/webapp/WEB-INF/lib /src/main/webapp/WEB-INF/myapp-servlet.xml /src/main/webapp/WEB-INF/web.x...

In IDEA, I setup to deploy using web app exploded, how do to .war file?

Using IDEA and tomcat I setup a simple spring mvc app (thanks to you guys) and it was deploying using a 'web app exploded' format. Is a .war file the same thing, except in a single file appname.war? How can I configure IDEA to do this? how do I have IDEA make a .war file during compilation and/or deployment? how do I link this to t...

spring exception

Hi, I am following this tutorial http://static.springsource.org/docs/Spring-MVC-step-by-step/part4.html to try and learn Spring. Everything worked fine but when i got to part4 and made the changes at section 4.3 i get a runtime exception SEVERE: Context initialization failed org.springframework.beans.factory.CannotLo...

Eclipse Spring IDE 2.3.2 plug-in vs. SpringSource Tool Suite 2.3.2

I'd like to play around with Spring for an upcoming JEE project. Is there any difference between the Eclipse Spring IDE 2.3.2 plug-in (in the new Eclipse Marketplace) and the SpringSource Tool Suite (available at SpringSource). More precisely: In my understanding, the Tool Suite is basically Eclipse 3.5 with a set of plug-ins. So the qu...

How to hide method from the Spring bean?

I have a bean which extends other Java file. When I create a Spring bean all public methods (from my and from extended files) are exposed. How can I hide not needed methods in bean XML config, so they are not exposed? Added explanation: I expose my beans via RDS for Flex application. So, my beans are available over network. With unneed...

How to do the model part in a Spring MVC?

Hi, I am working on a tutorial problem using Spring MVC, with another teammate for an internship. I'm not familiar with Spring (that's why I'm learning it) We first wrote the code without any framework support, plain old hand-written MVC We are using Spring 2.5, and integrated Hibernate, used the Autowire, Controller, Repository annota...

Using Velocity's WebappResourceLoader with Spring

I'm trying to use Velocity to create an email template that is mailed by Spring's JavaMailSender class. The resource loader that I decided to use to find the Velocity template in my web app is WebappResourceLoader which is located in the Velocity tool jar. However, depending on how I use the WebappResourceLoader, I get either a NPE w...

Spring/JTA/JPA DAO integration test doesn't rollback?

My DAO integration tests are failing because entities created during the tests are still in the database at the start of the next test. The exact same behavior is seen from both MySQL 5 and H2. The test classes are annotated with: @Transactional @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration( { "/testPersist-application...

First steps with freemarker with spring mvc

So I have Index action in my HomeController.java class. I have my freemarker templates in: /web-inf/ftl/test.ftl How can I load the template? I have this in my appname-servlet.xml: <bean id="viewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"> <property name="suffix"> ...

what is the fastest way to get performance metrics of all spring services?

what is the fastest way to get performance metrics of all spring services? ...

When using .jsp's view spring mvc, and passing ModelAndView, how to output model?

If I have a modelandView like: ModelAndView mav = new ModelAndView(); mav.setViewName("index"); mav.addObject("message", "hello, world"); return mav; In index.jsp, how do I output the value of "message"? And what if I passed in: mav.addObject("user", currentUser); It seems the docs jump straight into forms handling. ...