[opencms-dev] Spring MVC integration. Pass parameters to

jacek grzebyta (RRes-Roth) jacek.grzebyta at bbsrc.ac.uk
Tue Apr 27 18:32:07 CEST 2010


Hi guys,

I have a spring servlet hello.spr which is controlled by class HelloPage (which call real hello.jsp).
I created in paragraph a filed (OpenCmsString) where I can put path to the view eg /hello.spr.

This field is parsed by <c:import url="fullurl"/>

My question is how to put a parameter to the view if I have /hello.spt?test=value
Which give me:

<c:import url="/hello.spt?test=value"/>

In controller I have:
	@RequestMapping(method = RequestMethod.GET)
	public String goHello(@RequestParam("test") String test) {
		log.info("+++++++++++|" + test + "|+++");
		return "hello";
	}

Which doesn't work at all. I mean goHello is not call at all.

If I have @ModelAttribute("test") then the method is call but attribute "test" is null.

I guess i should call in the template like:
<c:import url="/hello.spr">
	<c:param name="test" value="value"/>
</c:import>

But it doesn't work as well.
So how to pass arguments to spring views?

Thanks a lot,
Best wishes,
Jacek



More information about the opencms-dev mailing list