spring-mvc

Spring 2.5 Controller Annotations

Spring MVC Question. I need to port a Spring 2.5 app to a Spring 2.0 Jboss server. The only Spring 2.5 constructs used are the following Controller Annomations: @Controller, @RequestMapping, @ReqestParm, @ModelAttribute and @Autowired. I am having difficulty determining which base controllers to extend or implement. Any thoughts on how...

Spring MVC, Design Question

I am starting out with web development under Java EE and spring and have a high level design question: I have a basic shell set up: I have coded some domain objects (mainly getters and setters for various object attributes which I ultimately want displayed on the page). I am wondering what the proper way to tie everything together is on...

on submit action

I am trying to call submit action from javascript using simpleFormController of Spring but action calling only handleRequest but its not calling the onsubmit action ...

Can a freemarker viewpage be 'user' editable and secured?

If I let anyone modify a freemarker viewpage, can I somehow make it hack free? I know I read somewhere that I can make disable scriplets, but that was for .jsp pages so not sure if it will work with freemarker. I basically want a way where I can set the attributes that will be available on the page, and let web designers go into the pa...

Custom tag - get access to data in model?

I am creating a custom JSP tag by extending SimpleTagSupport. Normally in the view, I could do something like <c:out value="${key.attr}" /> using jstl to pull data from the model. My question is: when creating custom tags (by using SimpleTagSupport), how do I gain access to the data from the model? Thanks. Just to clarify, I need a c...

getting value from one controller to another controller

How can I get value from one controller to another controller using Spring framework ...

Does spring form taglib disabled attribute really have to resolve to a string?

I've been playing around with the spring form taglib lately and came across a fairly disturbing phenomenon. <form:select path="whatever" disabled="${true}"> Will render a select element that is NOT disabled <form:select path="whatever" disabled="${'true'}"> Will render a select element that IS disabled. This indicates to me that t...

How can I implement a redirect-after-post form with Spring's AnnotationMethodHandlerAdapter?

I would like to write a @RequestMapping style form controller that redirects after a validation error and round-trips the values and error messages into the GET requested form (the Spring docs always just show the view being rendered in directly in response to the POST). Essentially, I think this comes down to putting the BindingResult i...

Spring file upload in a mixed form

I want to upload a file to my spring 3.0 applicatoin (created with roo). I already have the following entity: @Entity @RooJavaBean @RooToString @RooEntity public class SelniumFile { @ManyToOne(targetEntity = ShowCase.class) @JoinColumn private ShowCase showcase; @Lob @Basic(fetch = FetchType.LAZY) private byte...

Spring MVC 3.0.0 app won't bootstrap on Weblogic Server 11gR1 - ClassCastException

I have a Spring MVC (3.0.0.RELEASE) based application I need to deploy to Oracle Weblogic Server 11gR1. It works fine on Spring TC Server. When I deploy my application WAR file (either via STS/Eclipse "Servers" view or to the "auto-deploy" folder, or manually via the web admin) I get the following exception: <Feb 3, 2010 9:17:20 AM...

Spring MVC configuration question

I have a basic Java EE Spring (MVC) application setup that displays a home page with dynamic content. I am completely new to Spring and am confused how to proceed at this point and add more pages to my application. Do I need to create a new controller for each url on my site? Right now I have the following mapping in my ..-servlet.xml...

What's wrong with my Url Mappings?

I am trying to map a couple urls to their respective controllers as follows: /index.html => HomeController /login/index.html = LoginController My mapping bean in my servlet xml looks like this: <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <map> <entr...

Spring application root variable

I access my Spring application right now as follows: http://localhost:8080/my-app In my JSPs I'd like to have access to my application root instead of hardcoding hyperlinks to the homepage as <a href="/my-app">. Is there some sort of variable that I can access in my jsps to point to the application root? Thanks ...

Spring controller setup question?

I am using Spring MVC to develop a Java webapp. I have a setup as follows: 2 pages of the site are responsible for rendering similar content. One of the pages simply renders the items slightly differently (and hence would need a different view), and pulls the data slightly differently (with a limit on the query instead of pulling all t...

Java - Spring MVC - Automatically populate object from form submission?

In ASP.NET MVC in the controller I can just have an object from my model be a parameter in one of my methods, and a form submission that gets handled by that method would automatically populate the object. eg: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit(User u){...} The user object will automatically be populated for be f...

Request handling methods in spring

Which method is better to used to handle the request whether to use requestHandle of AbstractController or formBackingObject of AbstractFormController in the spring framework? ...

Spring MVC Session Attribute Access

Is there any way under spring 3.0 to access the HttpSession without including it in the method signature? What I really want to do is be able to pass in values from an HttpSession that CAN BE null. Something like this: @RequestMapping("/myHomePage") public ModelAndView show(UserSecurityContext ctx) {} instead of this: @RequestMappin...

Spring MVC 3.0: how do I define an interceptor with annotations?

I am developing an app with Spring MVC (3.0). I defined some controllers with annotations, how can I define an intereceptor with annotations too. ...

How does Spring resolve views?

I've been having a little trouble with View Resolution under Spring 2.5.5. Basically I'm just trying to show my view with a message from the controller passed in. The issue comes when the Controller returns the ModelAndView but the DispatcherServelt says it can't find a Handler. All the files seem to be in the correct place. I think the...

Trying to match an AspectJ pointcut signature for any methods containing a variable

I want to create a pointcut that matches any method in my Web controller that contains a ModelMap: pointcut addMenu(ModelMap modelMap) : execution (public String example.web.MyController.*(..)) && args (modelMap); before(ModelMap modelMap) : addMenu(modelMap) { // Do stuff with modelMap... } My problem is that this only matc...