• Post Reply Bookmark Topic Watch Topic
  • New Topic

calling a method in jsp

 
Valarie Brandt
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

please help me on this---- I keep getting the error type expected on this line: <%! propManager.getProperty("projectDesc") %>
i have tried it with a semicolon after the paren and got the same message.

here is the rest of my code
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try



I guess that you are just trying to get familiar with JSP's. In general, having methods in JSP's turns into a maintenance nightmare. You should do all your processing in normal Java classes, and use JSP's only to display the data.

HTH
 
vinoth khanna
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The line
<%! propManager.getProperty("projectDesc") %>
contanins the fundamental syntax error.

THe <%! .. %> is declaration tag for JSP.That why
Try <%= .. %> it will work.

Thanx.
Vinod
 
Logan Owen
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The <%= %> tags only work to print out a string that is returned by the code betweent them. This is the same as writing the code:

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The <%= %> tags only work to print out a string that is returned by the code betweent them.


I believe that was the intent of the poster.

And, it doesn't have to be a string; the expression within the delimiters can return any class or primitive. In the case that a class is returned, the toString() method is called on the class to determine the value to emit.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!