spring-mvc

Shared bean between portlets in separate war files

I'm developing a 'user settings portlet' where users can effect the search behaviour of multiple other portlets. The way I'd like to do it is by a shared bean. All portlets are in different wars, and I'd rather avoid having all wars in a single ear and using a parent application context, so deployment of portlets can be made autonomously...

Spring MVC - JSTL - Session Attribute

Hi: I have a Spring Controller where I am setting a session object with variables . @RequestMapping("/index.html") public String indexHandler(HttpSession session, HttpServletRequest request, HttpServletResponse response){ session ...

Error when publishing Spring application to Geronimo web server

I'm trying to set up Spring with Geronimo web server, but I'm getting the following error: 2010-10-08 18:52:45,105 WARN [PathMatchingResourcePatternResolver] Cannot search for matching files underneath URL [bundle://316.0:1/com/unveiled/politics/] because it does not correspond to a directory in the file system java.io.FileNotFoundExce...

No adapter for handler exception

Hi, I'm developing a web application using spring mvc framework. I want to to both annotation and beanName based url mappings. I've the following configurations in my context file <mvc:annotation-driven /> <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"></bean> My annotation based controllers are wor...

How to create a model ( not an entity ) ?

Hello, am doing a website using spring-mvc. how do i create a model? i used to create entity which represent a table from the database. but what if i want to create a model,which will consist in many columns from differents tables? thanks for advise ...

Dynamic Command Class in Annotated Controller

As of Spring MVC 3, AbstractCommandController is deprecated so you can no longer specify the command class in setCommandClass(). Instead you hard-code the command class in the parameter list of a request handler. For example, @RequestMapping(method = RequestMethod.POST) public void show(HttpServletRequest request, @ModelAttribute("empl...

Spring MVC: Mapping Multiple URLs to Same Controller

I have like 20+ forms which are linked from the same page. Some forms share the same controller, while others use their own. For example, form A, B, and C use DefaultController, while form D uses ControllerD. What I would like to achieve is to map the URL to each form in a consistent way. So, ideally, the link page would look like either...

How to manage validation in GET form and submit POST form?

Hi all, the enviroment is Spring 3.0 with new function Vallidation. I create an annotated controller (ResetUserPasswordController) which manages a showForm on HTTP.GET and the submit form on HTTP.POST. The function is a reset user password requested by email : the user access previously to another form, where i fill is email address an...

Spring MVC - URL Handling Problem

Hello to everyone, I'm trying to setup a Spring MVC project. I posted my configuration files below. I'll be really glad if someone helps me. Thanks in advance, With regards, Talha. web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/java...

Spring MVC application context path

Hi all. My Spring MVC application is runnning on a Tomcat behind an Apache 2 acting as a proxy. I access my app directly in tomcat via an url like http://localhost:8080/myapp. I access my app via proxy with an url like http://localhost/tomcat/myapp. The second url makes my app behave incorrectly, because it supposes it lives in /myapp...

Spring MVC framework very basic Dispatcher question.

When I'm looking at Spring FrameWork 3.0 I see the following code example: @RequestMapping("/index.dlp") public ModelAndView index(){ logger.info("Return View"); return new ModelAndView("index"); } This option doesn't work for me. Only when I change the code the following way: @RequestMapping("/index.dlp") public ModelAnd...

Spring - applicationContext.xml cannot be opened because it does not exist

Hello! I have a Spring MVC application and a problem with JUnit tests combined with the file applicationContext.xml. In my JUnit test class I write: final ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); service = (TestServiceImpl) context.getBean("testServiceImpl"); The error I get is that ...

Can a Spring bean be a property of itself in its declaration in applicationContext.xml?

I need to call public methods of the rubberStampService from inside the RubberStampServiceImpl class. To reference the rubberStampService from inside itself, can I make a self-referential bean declaration like this: <beans:bean id="rubberStampService" class="com.rubberly.RubberStampServiceImpl"> <beans:property name="rubberStampSer...

Calling axis2 secured web service (Username Token ) from spring mvc app

Hi all, Any sample available to call axis2 secured web service (Username Token ) from spring mvc app? ...

VTL evaluate or define an object reference

Hi, I would like to create a macro that takes a string as a parameter and evaluates that to an object. Something like: #macro( valueTest $objRef) #define( $obj )#evaluate("$${objRef}")#end $obj.foo ## This would have to be translated to $obj.getFoo() #end Unfortunately the $obj variable does not point to object reference that cou...

How can you have two URL routes mapped to the same handler method in Spring MVC (3.0)?

I have a a userPanel method mapped to the /user/panel URL route: @RequestMapping(value = "/user/panel", method = RequestMethod.GET) public final String userPanel(HttpServletRequest request, ModelMap model) However, I would also like the userPanel method to handle the route /panel without creating a separate method such as this: @Requ...

Pre-existing session required for handler method xxxxx

I am getting this exception when I authenticate a user on facebook and facebook redirects to callback... Before sending the request to facebook, the session is there but on calling the callback it creates a new one? I am using MultiActionController of spring and session is the 3rd param of the method signature. Would I need to use coo...

JSP/servlet read parameters from properties file?

My JSP pages need to display different information depending on which environment they're in (dev, production, sandbox, etc). I want to have a properties file for each of these environments that contain all the parameters they might need. How can I reference the properties from this file in a JSP page? My thoughts are: Have a servle...

Spring MVC security based on Session Attribute

I am using a Security scheme that is based on session attributes. I know that Spring has Acegi Security but I dont have much time to study that module. I just want to share this out to solicit comments from experts here. The pseudocode is like this. On successful Login, I am setting an attribute on user session. The object that I ...

Is Log4J Logging a Costly Transaction?

Logger Hi, I have a Spring MVC webapps that needs some server side logging so I configured Log4J in my Spring MVC <listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener> In my controller, I logged all user transaction. @Controller public class MyController { protected final Log log...