Deepinder S Narang

Greenhorn
+ Follow
since Sep 05, 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 Deepinder S Narang

What he is trying to say over here is that if the TARGET is set to a bean by the expression and the property mentioned in c:set does not exist in the bean then an exception will be caused but EL will simply return null and the result printed will be blank value. So no exception thrown will be shown on the jsp page.

But in case we are setting the TARGET using the expression and that property, which was supposed to set the value of the TARGET does not exist then it will generate an exception.

Correct me if i am wrong friend .........
well getting the host unreachable message ..........
now the error message is

exception

javax.servlet.ServletException: javax.servlet.jsp.JspException: Problem accessing the absolute URL "http://64.177.220.166/skyler/horse.html". java.net.NoRouteToHostException: No route to host: connect
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:821)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.Using_0020JSTL_jsp._jspService(Using_0020JSTL_jsp.java:348)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.net.NoRouteToHostException: No route to host: connect
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
java.net.Socket.connect(Socket.java:452)
java.net.Socket.connect(Socket.java:402)
Hello Friends

Rest all things are working with jstl including the import from within the webapp itself. But importing from outside is not working.
Can somebody suggest why ?

<c:import url="http://www.wickedlysmart.com/skyler/horse.html" />

Error received

exception

javax.servlet.ServletException: javax.servlet.jsp.JspException: Problem accessing the absolute URL "http://www.wickedlysmart.com/skyler/horse.html". java.net.UnknownHostException: www.wickedlysmart.com
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:821)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.Using_0020JSTL_jsp._jspService(Using_0020JSTL_jsp.java:264)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.net.UnknownHostException: www.wickedlysmart.com
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
java.net.Socket.connect(Socket.java:452)
java.net.Socket.connect(Socket.java:402)
sun.net.NetworkClient.doConnect(NetworkClient.java:139)
sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
sun.net.www.http.HttpClient.<init>(HttpClient.java:306)


Thanks in advance !
Hello

It is mentioned that when the attributes are not found in pageScope then they are looked for in request and then session and then application.

But what if i have mentioned the scope=session and it doesnt get the attribute there ......... will it start searching from page or will search in only applicationscope as only that thing comes after session scope in the hierarchy .... ?
Vani

you were right ....... it requires standard.jar also and now is working fine

Thanks Frens
The jstl.jar is in

C:\My_Folder\jakarta-tomcat-5.0.27\webapps\employeedetails\WEB-INF\lib
Hello Frens

Inspite of me having jstl.jar in my web app's lib i am getting the following error :

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:118)
org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:147)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

My JSP page is as follows :

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<h3>
Chapter 9 - Using JSTL
</h3>
</head>
<body>

<%
String names[]={"A" , "B" , "C" , "D"};
request.setAttribute("names",names);
%>


</body>
</html>
Thanks a lot guys it's workin !

Was out of town ....... that's why sending delayed reply
Hello friends ....

my below mentioned 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> DataBaseName </uri>
<function>
<name> getRandomnumber </name>
<function-class> com.example.model.Random </function-class>
<function-signature> void getDbname </function-signature>
</function>
</taglib>

gives the following error

org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: XML parsing error on file /WEB-INF/myFunction.tld: (line 2, col 6)
org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:249)
org.apache.jasper.compiler.TldLocationsCache.getLocation(TldLocationsCache.java:220)
org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:475)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:417)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

for the following class

package com.example.model;
public class Random{
int randomnumber;
public static int getRandomnumber(){
return (int) (Math.random() * 100);
}

}

Please help !

Thanks.
friends .... type attribuite if used with out the class attribute gives me the follwoing exception ..... please guide as to where the problem is

SUPER CLASS
package com.example.model;
public abstract class DBNameForJSPSuper {
private String dbversion;
public void setDbversion(String version){
System.out.println("Inside setDbversion");
dbversion=version;
}
public String getDbversion(){
System.out.println("Inside getDbversion");
return dbversion;
}
}

SUBCLASS
package com.example.model;
public class DBNameForJSP extends DBNameForJSPSuper{
private String dbname="Deepinder";
public DBNameForJSP() {}
public void setDbname(String name){
System.out.println("Inside setDbname");
dbname=name;
}
public String getDbname(){
System.out.println("Inside getDbname");
return dbname;
}
}

JSP CODE
<jsp:useBean id="DBNameTest" class="com.example.model.DBNameForJSP" type="com.example.model.DBNameForJSPSuper"
scope="application" >
<jsp:setProperty name="DBNameTest" property="dbname" value="Singh" />
</jsp:useBean>

<br><br><b> The DB name stored in JSP is : </b>
<jsp:getProperty name="DBNameTest" property="dbname"/>

--> if above class attribute is ommitted then the foll. error msg comes

ERROR MESSAGE
org.apache.jasper.JasperException: Cannot find any information on property 'dbname' in a bean of type 'com.example.model.DBNameForJSPSuper'
org.apache.jasper.runtime.JspRuntimeLibrary.getReadMethod(JspRuntimeLibrary.java:837)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1013)
org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:1062)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Generator.generate(Generator.java:3269)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Please help guys !!!
thxs !

it works after mentioning the veriosn no. .......
this verion realted info. wasnt available in HFSJ
even i had faced the same problem ........ inspite of the syntax being correct