• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why EL method is not accepting dynamically generated arguments

 
Jay Josh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am trying to call a method using EL inside JSP. The argument for the method is dynamically generated.

I am getting the following Exceptions.



I have a login page as shown below

Login.jsp



This page will take name and password for members. When user submits information then control will go to MemCheck.jsp shown below



Inside MemCheck.jsp I am calling a method through EL. The method mapping is done by using 'memCheck.tld' file shown below



The actual method memberChk() present in java class MemberCheck.java shown below



I am using Tomcat 7, Eclipse Java EE IDE mars.2 (4.5.2).

When I am changing code in MemCheck.jsp to



Then its working perfectly and giving output as "John Smith You are a member".

How can I pass dynamically generated 'Member name' parameter to method memberChk() using EL?

Can we nest EL expressions ? If No then How to achieve correct output by using ONLY 'EL expression' in the MemCheck.jsp ? Is it possible?

Also is there rules defined for eligible EL method arguments like only bean or map could be EL method arguments.

I am also attaching project directory.

Please help.

Thanks
Jay



ELMethodWithArgsPjt.jpg
[Thumbnail for ELMethodWithArgsPjt.jpg]
Project directory
 
Dave Tolls
Ranch Hand
Posts: 2207
20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need the '$' for the parameter:
${mem:getCheckResult(param.memName)}
 
Jay Josh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dave

Thanks for the reply. Its working now. I am reading through the evolution of web technology. From servlet->jsp->EL->jsf->spring etc. Hope I am following the right path.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65417
100
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ${} surrounds an entire EL expression; it's not a fetch operator. You need use if inside another ${} delimited block.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!