Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem using bean in jsp  RSS feed

 
gaurav chhabra
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sir
i like to include beans in my program and it is giving the error but i m not understanding why please helpme out--:::


beantest.jsp

<html>
<head><title>JAI SHRI RAM</title></head>
<body>
<jsp:usebean id="test" class="simplebean" />
<jsp:setProperty name="test" property="message" value="jai mata di" />
<jsp:getProperty name="test" property="message" />

</body>
</html>


simplebean.java

public class simplebean
{
String message="jai shri ram";

public String getMessage()
{
return(message);
}

public void setMessage(String message)
{
this.message = message;
}
}

i dont know why this is giving error of jasper
plz help me out
thank you
gaurav
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

add the following snippets in your jsp page.



Original coding was



and add in your simplebean.java
try this now

bye for now
sat
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!