naveen jayant

Greenhorn
+ Follow
since Jun 11, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by naveen jayant

hi i could not understand the difference between the following statement
both produce same result

<%=request.getParameter("email")%>
<%out.print(request.getParameter("email"))
16 years ago
JSP
Thanks Bear!
I got solution..
bye
16 years ago
JSP
want to try out a simple JSP example that uses beans. The code is
given below . What I don't understand is where do I have to put these files. I have configure Bean in Web.xml file .I guess the file I have really doubts about is StringBean.java which is the bean file. I tried putting all in
C:\tomcat4\webapps\webdir\WEB-INF\classes but nothing seems to work. I
keep getting this error:

org.apache.jasper.JasperException: Unable to compile class for JSP

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 15 in the jsp file: /StringBean.jsp
Generated servlet error:
F:\naveen\Tomcat 5.0\work\Catalina\localhost\JspBean\org\apache\jsp\StringBean_jsp.java:56: cannot find symbol
symbol : class StringBean
location: class org.apache.jsp.StringBean_jsp
StringBean stringBean = null;
^

So can someone help me determine the correct directory structure and
where to put files. Thanks.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Using Java BEAN With JSP</TITLE>
</HEAD>
<BODY>

<TABLE BORDER=5 ALIGN="center">
<TR><TH CLASS="TITLE">
Using Java BEAN With JSP</TABLE>
<jsp:useBean id="stringBean" class="StringBean"/>

<OL>
<LI>Initial Value:
<I><jsp:getProperty name="stringBean"
property="message"/></I>
<LI>Initial value from jsp expression:
<I><%= stringBean.getMessage()%><I/>
<LI><jsp:setProperty name="stringBean"
property="message"
value="Best string Bean"/>
value after setting property:
<I><jsp:getProperty name="stringBean"
property="message"/>
<LI><% stringBean.setMessage("my favourite");%>
value after setting property with scriptlet:
<I><%=stringBean.getMessage()%></I>
</OL>
</BODY>
</HTML>


JSP bean:

public class StringBean {
private String message = "No message specified";

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

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


Help Me..
waiting for repply
16 years ago
JSP
i cound not understand the difference between abstraction and encapsulation. please help
16 years ago
it is printing 12, i could not understand how?
class TestOut
{
public static void main(String[] args)
{
int i=014;
System.out.println("valure of i:- " +i);
}
}
16 years ago