• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

catching invalid variable references (jsp + struts)

 
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
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • 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 Windows XP Java
  • 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 Windows XP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Csaba Szegedi wrote:thanks for your reply.


You are welcome
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!