aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes can property be given as * in jsp:getProperty Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "can property be given as * in jsp:getProperty" Watch "can property be given as * in jsp:getProperty" New topic
Author

can property be given as * in jsp:getProperty

Anoopriya Muthuswaami
Greenhorn

Joined: Nov 20, 2008
Posts: 25
Can anyone tell me what happens for the following code

<jsp:getProperty name="beanName" property="*"/>

Will it give translation error that it cannot find getter method with *?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

"Anoop",
Welcome to the ranch. It seems that you did not read the Naming Policy[/url] properly the last time you were warned. Please read it carefully and change your name accordingly (you need to set both first and last names). Thank you.


[My Blog]
All roads lead to JavaRanch
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Will it give translation error that it cannot find getter method with *?

No. The container sets whatever it can. If it does not find a setter corresponding to a request parameter name, it ignores it.
Anoopriya Muthuswaami
Greenhorn

Joined: Nov 20, 2008
Posts: 25
Originally posted by Christophe Verre:

No. The container sets whatever it can. If it does not find a setter corresponding to a request parameter name, it ignores it.


I tried by giving * in getProperty. It threw the following error

org.apache.jasper.JasperException: Cannot find any information on property '*' in a bean of type 'example.Person'
org.apache.jasper.runtime.JspRuntimeLibrary.getReadMethod(JspRuntimeLibrary.java:836)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1015)
org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:1063)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2216)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2222)
org.apache.jasper.compiler.Node$Root.accept(Node.java:457)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166)
org.apache.jasper.compiler.Generator.generate(Generator.java:3324)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Sorry Anoo, I misread getProperty with setProperty. You cannot use "*" with getProperty.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can property be given as * in jsp:getProperty