Puja Verma

Greenhorn
+ Follow
since Jul 01, 2006
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 Puja Verma

Hey friends...

I am planning to take SCWCD exam day after tomorrow. Today when i have taken the Mock exam given in end of the HFSJ book, I got worst percentage i have ever imagined off.
When i took mock exams from Jdiscuss I got atleast acceptable score.

Can anyone help me wat is the level of actual exam... Is its level is same tat of jdiscuss or is same as HFSJ mock exam???
please help me..........

Regards,
Pooja
thanks... Mohd Fuzail and Surendra Nichenametla

I tried executing my program from C:\MyProjects\beerV1\ directory
and its working ......
It has created class file in the beerV1\classes\com\web, as desired.

Once again ...thanks for your help
pooja
Hi friends....

I am getting problem in compiling my programs from command prompt in WINDOW Operating system.
I am giving :

C:\Program Files\Java\jdk1.5.0_06\bin>javac -classpath "C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.jar" -d classes C:\MyProjects\beerV1\src\com\example\web\BeerSelect.java

and output m getting :

C:\MyProjects\beerV1\src\com\example\web\BeerSelect.java:5: error while writing com.example.web.BeerSelect: classes\com\example\web\BeerSelect.class (The system cannot find the path specified)
public class BeerSelect extends HttpServlet {
^
1 error
=======================================================================
Well I have directory structure as MyProjects\beerV1\classes\com\web and MyProjects\beerV1\src\com\example\web where i have put my servlet program.


Till now I have been using "IBM Web Studio Application Developer" for my application development.
But with that i am encountering problems in implement the JSTL ...taglibs programs..
So thot to use the general method to test programs.

Can you please help me ............
thanks,
pooja
greatest score ... congrats for such a phenomenal achievement..

I am preparing for the SCWCD and m also trying to make notes , what i understood. But i would like to have your too..becoz your score tells what kind of note you wud have made ....

Can you send that file to poojagverma@yahoo.com...

Best of luck for your next step on success ladder...
thanks..
removing DOCTYPE is not making any difference in my outcome... Can you see anything else could be the problem in this code ???
thanks for your help ... I am using WIZAD application developer and might be becoz of that I am getting this problem. I think now i should start using command line to run my programs and might be i will get the desired output by that... Anyways thanks of helping me
hey friends.....

I am trying to implement the example given in chapter 10 of HFSJ, which is about tag files...

Here is my code.
My tag file in WEB-INF/tags directory :

<%@ attribute name="subTitle" required="true" rtexprvalue="true" %>
<strong> ${subTitle} </strong>
<img src="test.jpg"> <br>
=======================================================================
my jsp file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib prefix="myTags" tagdir="/WEB-INF/tags" %>
<HTML><BODY>

<myTags:Header subTitle="testing subtile in JSLT" />

</BODY></HTML>
=======================================================================
my Web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd" id="WebApp" version="2.4">
<display-name>Test_JSTL</display-name>
</web-app>
======================================================================
Out which I am getting is :
${subTitle}
......................................................................
Why my subTitle has not been displayed ???
THis EL problem has been coming everytime... Last time the problem was with version in web.xml.
This time i have given it as 2.4 then also ............

Can anyone help me out to solve this problem...

thanks,
pooja
hey shivani... Congratulation for your success.. and best of luck for next step in success ladder...

thanks,
pooja
1. My .tld file is in WEB-INF
2. My DiceRoller class files is in classes.foo directory
3. I think no need to say that i have restarted my web server after every changes...

Only thing remain is the libraries and web.xml part.... Do i need to have some specific library for this or do i need to put some specific details in my web.xml ???
Here is my web.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd" id="WebApp" version="2.4">

<display-name>ELTest</display-name>

</web-app>


Do you think there is some problem in this web.xml??
thanks,
Pooja
HI friends...

I am trying to implement the rollIt program of HRSJ, but I am encountering some problem in excuting my rollIt function.

Here is my code :

TestBean.jsp
<%@ taglib prefix="mine" uri="DiceFunctions" %>
<html>
<body>

${mine:rollIt()}

</boby>
</html>
=========================================================================
Tld file :
<?xml version="1.0" encoding="ISO-8859-1" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" version="2.0">
<tlib-version>1.2</tlib-version>
<uri>DiceFunctions</uri>
<function>
<name>rollIt</name>
<function-class>foo.DiceRoller</function-class>
<function-signature> int rollDice() </function-signature>
</function>
</taglib>
=========================================================================
My rollDice function
package foo;

public class DiceRoller {

public static int rollDice()
{
return (int)((Math.random() * 6 ) + 1);
}

}
===========================================================================
Out which I am getting is :
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: The class specified in the method signature in TLD for the function mine:rollDice cannot be found.
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:365)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:216)
at org.apache.jasper.compiler.Validator$1$MapperELVisitor.visit(Validator.java:1380)
at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:159)
at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:230)
at org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:268)
at org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:92)
at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:230)
at org.apache.jasper.compiler.Validator$ValidateVisitor.getFunctionMapper(Validator.java:1395)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:669)
at org.apache.jasper.compiler.Node$ELExpression.accept(Node.java:821)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2017)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2059)....................................................................................................
===========================================================================

I dont understand why it is not executing the function and printing the statement as it is...

........................................................................
thanks,
Pooja
EL
I too got same type of problem and it got resolved by specifying the version as 2.4.
You can check by specifying version as 2.4
e.g

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd" id="WebApp" version="2.4">



thanks,
Pooja
--------------------
HI friends...

I am trying to implement the rollIt program of HRSJ, but I am encountering some problem in excuting my rollIt function.

Here is my code :

TestBean.jsp
<%@ taglib prefix="mine" uri="DiceFunctions" %>
<html>
<body>

${mine.rollIt()}

</boby>
</html>
=========================================================================
Tld file :
<?xml version="1.0" encoding="ISO-8859-1" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" version="2.0">
<tlib-version>1.2</tlib-version>
<uri>DiceFunctions</uri>
<function>
<name>rollIt</name>
<function-class>foo.DiceRoller</function-class>
<function-signature> int rollDice() </function-signature>
</function>
</taglib>
=========================================================================
[B]My rollDice function[/B]
package foo;

public class DiceRoller {

public static int rollDice()
{
return (int)((Math.random() * 6 ) + 1);
}

}
===========================================================================
Out which I am getting is :

${mine.rollIt()}
===========================================================================

I dont understand why it is not executing the function and printing the statement as it is...

........................................................................
thanks,
Pooja
thankx .....
its working now

but i dint get it , why was the problem in giving function name with underscore ???
Hi friends...

My form.html:
<html>
<body>

<h1 align="center"> JSLTPage </h1>
<form method="POST" action="result.jsp">
Name : <input type="text" name="empName">
ID# : <input type="text" name="empID">
<input type="SUBMIT">
</form>
</body>
</html>
===================================================================
Person class :
package foo;
public abstract class Person {
String empName;

public String get_empName()
{ return empName;
}
public void set_empName(String s)
{ empName=s;

}
}
=====================================================================
Employee Class :

package foo;
public class Employee extends Person{
String empID;

public String get_empID()
{ return empID;
}
public void set_empID(String s)
{ empID=s;

}
}
========================================================================
my result.jsp

<html>
<body>
<jsp:useBean id="person" type="foo.Person" class="foo.Employee" scope="request">
<jsp:setProperty name="person" property="*" />
</jsp:useBean>
Person Created by Servlet : <jsp:getProperty name="person" property="empName"/>
Person Created by Servlet : <jsp:getProperty name="person" property="empID"/>
</boby>
</html>
==========================================================================
My error :



HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Cannot find any information on property 'empName' in a bean of type 'foo.Employee'
at org.apache.jasper.runtime.JspRuntimeLibrary.getReadMethod(JspRuntimeLibrary.java:871)
at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:958)
at org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:974)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2017)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2059)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2065)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:423)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2017)
at org.apache.jasper.compiler.Generator.generate(Generator.java:2907)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:291)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:444)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:593)

.......................................... and so on...............
=========================================================================

I dont understand, why m unable to access my empName from employee class???

Please help me out....

thanks...
pooja
congrats...really very good score