Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Kiran Kumar Boyini
Issue while get the entity object from action class to jsp page.
2 gennaio 2013 5.03
Risposta

Kiran Kumar Boyini

Punteggio: Expert

Messaggi: 281

Data di Iscrizione: 2 giugno 2011

Messaggi recenti

Hi All,


I am trying to get the entity object from the action class(controller) to jsp page.But I have got the issue.I have tried so many ways.

But I am unable to find out where I mad mistake.

I am using the MVCPortlet:
In side the action class code as follows:
1
2InsurancePolicy insurancePolicyObj=InsurancePolicyUtil.fetchByPrimaryKey(hiddenPolicyId);
3                    actionRequest.setAttribute("insurancePolicyObj", insurancePolicyObj);


Inside the jsp page as follows:

1
2<%
3InsurancePolicy InsurancePolicyObj=(InsurancePolicy)renderRequest.getAttribute("insurancePolicyObj");
4out.println(insurancePolicyObj.getDescription());
5%>


Issue inside the log file:
1
2[color=#f13535]insurancePolicyObj cannot be resolved
323: InsurancePolicy InsurancePolicyObj=(InsurancePolicy)renderRequest.getAttribute("insurancePolicyObj");
424: out.println(insurancePolicyObj.getDescription());[/color]


Please tell me am I missing any thing ?

Regards,

Kiran
Bart Simpson
RE: Issue while get the entity object from action class to jsp page.
2 gennaio 2013 5.36
Risposta

Bart Simpson

Punteggio: Liferay Master

Messaggi: 524

Data di Iscrizione: 29 agosto 2011

Messaggi recenti

http://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html
In your code you have it as InsurancePolicyObj
InsurancePolicy InsurancePolicyObj=...

but you are using insurancePolicyObj
out.println(insurancePolicyObj.getDescription());
Hitoshi Ozawa
RE: Issue while get the entity object from action class to jsp page.
2 gennaio 2013 6.27
Risposta

Hitoshi Ozawa

Punteggio: Liferay Legend

Messaggi: 7949

Data di Iscrizione: 23 marzo 2010

Messaggi recenti

Yes, Java differentiates upper and lower cases so the statement in row 27 should be
InsurancePolicy insurancePolicyObj=...
with lower case "i"