Vani Chinta

Ranch Hand
+ Follow
since Mar 25, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Vani Chinta

Hi
I am going through tag files. container looks out for tag files in four locations.
i) web-inf/tags
ii) sub directories of web-inf/tags
iii) meta-inf/tags
iv) sub directories of meta-inf/tags
my doubt is when container is automatically looking out for tag files in these places, why do we have to mention tagdir attribute in taglib directive?
Hi
I am trying an example with body-content tag as scriptless. when I give EL in jsp, i am getting this exception. "org.apache.jasper.JasperException: /customtag.jsp(8,29) Expression language not allowed in a template text body."

Is n't EL allowed in tag body when body-content is specified as scriptless?

Here is my tld

<?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>customTags</uri>
<tag>
<description>Random advice</description>
<name>advice</name>
<tag-class>com.example.web.AdvisorTagHandler</tag-class>
<body-content>scriptless</body-content>
<attribute>
<name>user</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
</taglib>

and JSP:

<%@ taglib prefix="mine" uri="customTags"%>
<html>
<title>Custom Tag</title>
<body>
Using an advice custom tag
<mine:advice>
<jsp:attribute name="user">${userName}</jsp:attribute>
</mine:advice>
</body>
</html>
In Page 139 of HFSJ, it is mentioned that new URL appears on the address bar.
Should that be mentioned in Errata?
Thanks Marc for the clarification. Looks like it is caching the page. I passed parameters and it is working fine.
Hi
I am trying to direct a request "http://localhost:8080/ch4/dog.do" to some other jsp.

1) Does the new JSP path appear in Address bar of the IE page? I donot see the new jsp page in the address bar rather title of the IE has changed to reflect new jsp.

2) In the redirecting servlet I gave SOP statement which is not printed on to the console. Where am I going wrong? However the request is being redirected to the new jsp.


Here is the servlet code for reference.

package com.example.web;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class RedirectServlet extends HttpServlet{


public void doGet(HttpServletRequest request,HttpServletResponse response)
throws IOException,ServletException{


System.out.println("Inside redirecting servlet");
response.sendRedirect("/redirected.jsp");

}

}
Thanks for the useful study tips. even i get lost while going through those tags(tag handlers).
Congrats, I always wonder how can one complete certification in such a short span of time with a great score. I think it is just less than two months. Congrats once again for a brilliant work.
Hi,
What is the need/advantage to have JspContext in SimpleTags instead of pageContext as in CustomTags?
Has any one tried google books? "http://books.google.com/books?vid=ISBN0596005407&id=WoA3F0UQfvQC&pg=PA1&lpg=PA1&ots=QI1Jq8S75H&dq=head+first+servlet&sig=idxCTkKLATD_lMLaRpPTh5fETy4" Check it out.
Also check out whether you have safari online book store in your office. I read it in safari during work days and use hardcopy at home. it might not be that comfortable as using hardcopy, but just one of the ways to reach HFSJ.
Congratulations Mallika Shah.
Yes ST,
It is working with jsp. I tried that. Not sure what is different with .jspf
Hi,
I am trying to send param values to included jsp from main jsp using jsp:include and jsp aram standard actions. Included jsp is named as header.jspf. But when I try to display param attribute in the included jspf, it is not evaluating EL and the expression is printed as it is.
Here is my initparam.jsp which is calling an included jsp.[/CODE][/CODE][code]
<html><body>Passing parameters to included file using jsp aram
<jsp:include page="header.jspf">
<jsp aram name="jspName" value="initparam"/>
</jsp:include>

</body>
</html> [/code]

Here is included jsp named as header.jspf
[code] <h1> Header:SCWCD </h1>
${param.jspName} [/code]

I am able to see the param attribute value in the result,if I specify el-ignored to be "false" in DD for url pattern of type .jspf
[code] <jsp-config>
<jsp-property-group>
<url-pattern>*.jspf</url-pattern>
<el-ignored>false</el-ignored>
</jsp-property-group>
</jsp-config>
[/code]

My questions is since el-ignored is false by default, why is EL not getting evaluated . and why is it ignoring EL in the included fragment?

Should we specifically mention not to ignore EL in DD?

Thanks