View Full Version : Spring MVC +quercus php

02-13-2012, 09:47 PM
I use spring mvc and quercus php as view

<beans:bean class="org.springframework.web.servlet.view.InternalResou rceViewResolver">
<beans: property name="prefix" value="/WEB-INF/views/" />
<beans: property name="suffix" value=".php" />

in Controller:

@RequestMapping( value = "/list" )
public String list(
@RequestParam(value = "page", required = false) Integer page,
Model model) {
int pageNum = page != null ? page : DEFAULT_PAGE_NUM;
Page<Person> paging = personService.findAll(pageNum, DEFAULT_PAGE_SIZE);
model.addAttribute("page", paging);
return "/person/list";

View file: list.php

how can I get Object from controller at list.php?

02-15-2012, 05:09 PM
I use spring mvc, quercus php as view

Controller pass the modelandview to php

Person is a java entity

in my list.php file:

$request = quercus_servlet_request();
$person= $request->getAttrubute("person");

but I get string like

resource(Person[id=90, name=name90, age=91])

how can I get a normal php array

02-25-2012, 11:57 PM
It looks like your Person object is not an array class that quercus recognizes, so it didn't convert it to a php array automatically.

And in this context, resource(Person[id=90, name=name90, age=91]) means it's a java object and you can call any of its methods from php.