Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

catching invalid variable references (jsp + struts)

 
Csaba Szegedi
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

We are using JSP with Struts 1.2 and we had an invalid variable reference in the jsp page.
My question is: is there any chance to catch it later in the log or in any other else way ?



Thanks in advance.

Cs
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you cant access static variable using class name in EL. EL only evaluate methods of a bean via setters/getters .

So, work around would be create a setter/getter instance method for the static variable then create a instance for that class and put it request/session scope and access that as in,






For clean approach:
Please go through this (<= click) article


 
Csaba Szegedi
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My question was about catching this kind error.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Csaba Szegedi wrote:My question was about catching this kind error.

Oh, sorry . EL will not report error if the *Utils* property not found in any one of the scope.
So, I think you cant deal with such idiom .
 
Csaba Szegedi
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seetharaman Venkatasamy wrote:
Csaba Szegedi wrote:My question was about catching this kind error.

Oh, sorry . EL will not report error if the *Utils* property not found in any one of the scope.
So, I think you cant deal with such idiom .


No problem, thanks for your reply.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Csaba Szegedi wrote:thanks for your reply.

You are welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic