JSTL : not working with JSP 2.0
Hi
I was trying to run JSP 2.0 tag sample. here are the tag and jsp files.
wrapper.tag
<%@ tag body-content="scriptless" %>
<%@ attribute name="a" required="true" %>
<%@ attribute name="b" required="true" %>
<%@ attribute name="c" required="true" %>
<%@ attribute name="d" required="false" %>
<p> Header
<p> Attributes - ${a}, $, ${c}</p>
<table>
<tr>
<td>${a}</td>
<td>${b}</td>
</tr>
</table>
<p> Footer
---------- and my JSP is
main.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<tags:wrapper a="1" b="2" c="3" >
<p> Wrapped Content
</p>
</tags:wrapper>
web.xml contents
<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 http://java.sun.com/xml/ns/j2ee/web-app_2_3.xsd"
version="2.3">
when I ran main.jsp I am getting
Attributes - ${a}, ${b}, ${c}
instead of Attributes - 1,2,3
the values are not being evaluated. Any suggestion/help would be appreciated. I used version 2.4 also. but i am getting this error
"According to TLD or attribute directive in tag file, attribute value does not accept any expressions" when using 2.4.
Any idea??
Thanks
-Chandra K
As well as updating your web.xml to 2.4, you need to update the URI so that you use JSTL1.1 instead of JSTL1.0
If you are using JSP2.0 you should use JSTL1.1
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>[read this post reply #6 for more information|http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0]
Similar Messages
-
Filter does not work with *.jsp URL pattern???
Hi All,
I am, by no means, very good at JSF or Java. I have looked at various forum posts on here for ways to implement a security filter to intercept requests to pages that first require one to be logged in, and if not, redirect them to the login page. Yes, I know a lot of you have heard this many times before, and I'm sorry to bring it up again.
BUT, from the guidance of other posts, I have got a filter that works fine when the url pattern is set to "/faces/*" or "/<anything>/*", however it won't work for "*.jsp" or "*.<anything>"
My filter is as follows:
package test.security;
import javax.faces.context.FacesContext;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.http.HttpSession;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class SecurityFilter implements Filter{
/** Creates a new instance of SecurityFilter */
private final static String FILTER_APPLIED = "_security_filter_applied";
public SecurityFilter() {
public void init(FilterConfig filterConfig) {
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException{
HttpServletRequest req = (HttpServletRequest)request;
HttpServletResponse res = (HttpServletResponse)response;
HttpSession session = req.getSession();
String requestedPage = req.getPathTranslated();
String user=null;
if(request.getAttribute(FILTER_APPLIED) == null) {
//check if the page requested is the login page or register page
if((!requestedPage.endsWith("Page1.jsp")) /* This is the login page */
//set the FILTER_APPLIED attribute to true
request.setAttribute(FILTER_APPLIED, Boolean.TRUE);
//Check that the session bean is not null and get the session bean property username.
if(((test.SessionBean1)session.getAttribute("SessionBean1"))!=null) {
user = ((test.SessionBean1)session.getAttribute("SessionBean1")).getUsername();
if((user==null)||(user.equals(""))) {
// try {
// FacesContext.getCurrentInstance().getExternalContext().redirect("Page1.jsp");
// } catch (ServletException ex) {
// log("Error Description", ex);
res.sendRedirect("../Page1.jsp");
return;
//deliver request to next filter
chain.doFilter(request, response);
public void destroy(){
}My web.xml declaration for the filter is:
<filter>
<description>Filter to check whether user is logged in.</description>
<filter-name>SecurityFilter</filter-name>
<filter-class>test.security</filter-class>
</filter>
<filter-mapping>
<filter-name>SecurityFilter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
Note: I have also tried this with <url-pattern>*.jsp</url-pattern> for the filter mapping in place of the Faces Servlet
My web.xml declaration for the url pattern is:
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>Which JSC/NetbeansVWP automatically creates a "JSCreator_index.jsp" which has:
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:jsp="http://java.sun.com/JSP/Page">
<jsp:forward page="Page1.jsp"/>
</jsp:root>When run, this causes an Error 500 in the browser and a NullPointerException in SecurityFilter.java on the line:
if((!requestedPage.endsWith("Page1.jsp")) /* This is the login page */I think I'm missing something that would be obvious to anyone who knows better than me. Any ideas?Dear Ginger and Boris,
thanks for the information - the problem seems to ocur in EP7 as well, Boris told me it is fixed in SP15. We are on SP14 now, so there is hope !
actually the information in the oss note stated above is also true, as we have an Oracle DB. On a similar demo system (only difference is SQL DB) the hyphen search works !
best regards, thank you !
Johannes -
JSTL Not working with new xsd schema
I recently ran java weblogic.DDConverter to convert the web.xml and weblogic.xml files for an application, but had the following errors afterwards when refreshing the below jsp. I tried all sorts of things to fix the problem. Finally I reverted back to the weblogic 8.1sp5 version and the jsp compiled and worked okay.
Does anyone have any ideas why?
Thanks,
Eddie
<pre>
doclinks_list.jsp:789:25: Static attribute must be a String literal, its illegal to specify an expression.
<c:forEach var="col" items="${collist}">
^-----^
doclinks_list.jsp:789:25: Static attribute must be a String literal, its illegal to specify an expression.
<c:forEach var="col" items="${collist}">
^------^
</pre>if you want use it always,you can see reference to "http://www.blogjava.net/lyyb2001/archive/2007/06/20/125276.html"
Edited by: user11220726 on 2009-6-1 下午11:42 -
JSP include directive not working with Tomcat 5.0
Hi.
I'm developing a small JSF webapp under Tomcat 5.0. My idea was to use the include directive to display a navigation panel on every JSP page.
I took the code straight from the Java Web Services Tutorial; the resulting page looks like this:
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
version="2.0">
<jsp:directive.page contentType="text/html;charset=iso-8859-1"/>
<%@ include file="/jsp/panelpage_header.inc" %>
<h:outputText value="Welcome!"/>
<%@ include file="/jsp/panelpage_footer.inc" %>
</jsp:root>However, when I try to load the page, a compilation error occurrs:
org.apache.jasper.JasperException: /trias/welcome2.jsp(11,2) The content of elements must consist of well-formed character data or markup.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
...I checked the path to the included files, and it seems to be okay. The files themselves contain the JSF tags for the view, html-head, html-body etc. The compiler doesn't even care if the files exist or not because it aborts immediately when it reaches the first include-statement.
Did anyone see this kind of error before?Ok, the solution with jsp:directive.include works,
if header.inc and footer.inc themselves are well
formed too. If I understood the concept right this is
because header and footer are processed during
request time and therefore interpreted as
'standalone' pages.This isn't true. The include directive (<jsp:directive.include>) is run a Compile Time. The code is inserted directly into the surrounding JSP (unlike <jsp:include> which forwards the request at runtime). The finished JSP, after the include, is then processed and needs to be well-formed XML.
>
But: What can I do when these two files define a tag
that should enclose my current page (for example,
header opens a panelGrid-Tag, and footer closes it).
For this case I thought the use of the
@include-directive would be neccessary to combine the
three pages during compilation. By this the resulting
page would be well-formed although header and footer
are not.It should be, as long as you are using <jsp:directive.include>, and the rest of the included pages are also well formed (no <% %> tags, nothing else out of place...).
Honestly, I haven't done much work with JSP documents, so I haven't run into this problem. But I do believe everything I said is correct.
What I would do is double check the correctness of the rest of the included pages and see if your error isn't something else. -
JSP Not Working with Thin Driver
My JSP is not working with Oracle thin driver but it is working with Oracle OCI driver.
From my jsp i am calling a stored procedured and passing 170 parameters to the procedure. This JSP works with Oracle OCI Driver configured as thrid party drivers in iAS6.0 SP2, but not working with Oracle Thin Driver configured as third party drivers in iAS6.0. My thin driver JDBC Connection URL is as follows:
jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = MAPDBI01)(PORT = 1521)))(CONNECT_DATA =(SID = MAPS))).
I have to give this URL because my production server deployment consists of iWS4.1 SP5 and iAS6.0 SP2 in different solaris boxes and Oracle 8.1.7 Database server in another Solaris Box. There is a pool of proxy servers between iAS6.0 box and the oracle box.Wim,
I'd really appreciate it if you could provide some sample code. A complete, small, simple java class that I could copy and try out would be wonderful -- if it's not too much trouble.
Thanks heaps (in advance :-),
Avi. -
Does anyone know how to get rid of this problem? I have a jsp page including a sun java studio creator created page fragment using the tag:
<jsp:directive.include file="myHeader.jspf"/>
here myHeader.jspf is a page fragment.
after deployment, weblogic server report error as:
weblogic.servlet.jsp.CompilationException: Failed to compile JSP /Page1.jsp
Page1.jsp:15:57: Error in "C:\bea\user_projects\domains\base_domain\servers\AdminServer\tmp\_WL_user\proj\grb4mk\war\myHeader.jspf" at line 1: The encoding "null" specified in the XML prolog is unsupported.
<jsp:directive.include file="myHeader.jspf"/>
^----------------^
Any idea? I tried both weblogic 9 and 10, same error, change to
<jsp:include page="myHeader.jspf"/>
works. the question is: why not read jsp 1.2 tag? Any way to make it work with jsp:directive.include tag?
thanks in advance.
Edited by: user10243594 on Sep 10, 2008 10:22 AMThe "jsp:directive.include" tag is only valid in an well-formed XML file that specifies all the relevant namespaces. The "jsp:include" tag is used in a JSP file. I'll bet the beginning of your file shows that you don't have a valid and well-formed XML file.
If you found that "jsp:include" worked, then that confirms you have an ordinary JSP file here. Why are you trying to use the XML form? The result of "jsp:include" in a JSP file will be exactly the same as the analogous tag in an XML file. -
Prob in working with jsp 2.0 tags fil
hi all
i am facing a prob working with jsp 2.0 tags files and hope to receive a possitive responce from your good self:-
<p>
how could i create a instance of a user defined class in a tags files .
<p>eg.
<tb:firsttag tableName="customer" className="createtable" packagename="package1">
<BR>
</tb:firsttag>
what code i have to write in tag file to create a object of class createtable </br>
thanks in advance, waiting for ur cooperationI'm not sure I understand your question, but...
If you want to create a custom tag that will contain a body (data between the start and end tags) you will extend BodyTagSupport.
HTH. -
My big fish and Norton tool bar will not work with fire fox 4
My Big Fish Tool Bar and my Norton Tool Bar will not work with firefox4. However they work fine on internet explorer
Symantec need to update their Firefox add-ons so that they are compatible with Firefox 4. They have indicated that for Norton 360 they plan to release an update to Norton 360 to support Firefox 4 in early May - http://us.norton.com/support/kb/web_view.jsp?wv_type=public_web&docurl=20100720113635EN&ln=en_US
I do not know about the time scale for updates for other Norton products. Pending the update by Symantec, if you want to use the Norton add-ons you will need to downgrade to Firefox 3.6.
To downgrade to Firefox 3.6 first uninstall Firefox 4, but do not select the option to "Remove my Firefox personal data". If you select that option it will delete your bookmarks, passwords and other user data.
You can then install the latest version of Firefox 3.6 available from http://www.mozilla.com/en-US/firefox/all-older.html - it will automatically use your current bookmarks, passwords etc.
To avoid possible problems with downgrading, I recommend going to your profile folder and deleting the following files if they exist - extensions.cache, extensions.rdf, extensions.ini, extensions.sqlite and localstore.rdf. Deleting these files will force Firefox to rebuild the list of installed extensions, checking their compatibility, and reset toolbar customizations.
For details of how to find your profile folder see https://support.mozilla.com/kb/Profiles -
All my passwords are Norton identity safe protected. If firefox4 does not work with it I am forced to go back to IE. Previous versions had a patch. I only realized the problem after downloading the new update. I wish I never had.
Symantec need to update their Firefox add-ons so that they are compatible with Firefox 4. They have indicated that for Norton 360 they plan to release an update to Norton 360 to support Firefox 4 in early May - http://us.norton.com/support/kb/web_view.jsp?wv_type=public_web&docurl=20100720113635EN&ln=en_US
I do not know about the time scale for updates for other Norton products. Pending the update by Symantec, if you want to use the Norton add-ons you will need to downgrade to Firefox 3.6.
To downgrade to Firefox 3.6 first uninstall Firefox 4, but do not select the option to "Remove my Firefox personal data". If you select that option it will delete your bookmarks, passwords and other user data.
You can then install the latest version of Firefox 3.6 available from http://www.mozilla.com/en-US/firefox/all-older.html - it will automatically use your current bookmarks, passwords etc.
To avoid possible problems with downgrading, I recommend going to your profile folder and deleting the following files if they exist - extensions.cache, extensions.rdf, extensions.ini, extensions.sqlite and localstore.rdf. Deleting these files will force Firefox to rebuild the list of installed extensions, checking their compatibility, and reset toolbar customizations.
For details of how to find your profile folder see https://support.mozilla.com/kb/Profiles -
RequestDispatcher is not working with Tomcat 4.1
This is JSP's path
http://localhost:8080/myApp/Date.jsp
from this jsp i am calling below Servlet
this is my servlets path
http://localhost:8080/examples/servlet/SampleServlet
from the servlet i am trying to forward request to other JSP
but it sees like RequestDispatcher is not working with Tomcat
but i can able to call JSP using
response.sendRedirect("http://localhost:8080/myApp/Date.jsp");
OR
response.sendRedirect("/myApp/Date.jsp");
both works fine , but no combination is working with RiquestDispatcher.forword();
Any Guess ???.yes i have tried with ("/Date.jsp") also .
it gives me 404 error
Error description is
" The requested resource (/Date.jps) is not available"
i am getting same error for all possible combinations of URL iam giving
some of other URL's i have tried..
/examples/Date.jsp
/myApp/Date.jsp (myApp is my war file name deployed in webapps directory)
and many more
thanks for help. -
Versamail Auto-sync feature not working with AOL mail w/Treo 700p (Verizon)
I'm having a problem with the Auto-sync feature not working with my 700p (verizon) with my aol mail. It had worked perfect since May 2007. Just started having problems End of April 2008. Sounded like I needed another incoming mail server from aol other than: imap.aol.com, aol told me they also use pop.aol.com, that isn't working either. I get an error message that says "last auto-sync attempt failed."....Anyone else having this issue? I'm trying to decide whether to get rid of my aol mail of 14 yrs and use other address to continue using versamail 3.5 or keep aol and use Verizon Wireless sync. I do not like how wireless sync sends mail to outbox and then syncs vs sending right away. Please help...
Post relates to: Treo 700p (Verizon)I am having the EXACT same problem: Palm 700p, Versamail, AOL, Verizon.
It started about 1 month ago. The GET still works, but AUTO-SYNC does not...After spending hours on the phone with Palm tech support, and reaching someone who said AOL had changed something in their servers. They suggested TRYING Chatteremail, another Palm product. I have tried it for 20+ days out of the 30 days you get for free. It works pretty well, but NOT every e-mail that goes to my AOL acct is making it to my phone. The thing that's great about Chatter is that can be "live" all of time. Not auto-syncing every 15 minutes.
It's very frustrating....The same way the Versamail just stopping auto-syncing is very frustrating. With Versamail, sometimes I did not even get the error message. If Chatteremail worked consistently, I would bite the bullet, and pay for it, but to pay for it, and have it not pull down all the e-mails, all the time is not good.
I spoke to Palm Tech Support in N. America today, and they say the way AOL uses IMAP servers is in a non-traditional way, and it's very hard to deal with. They suggest ditching AOL, and using something reliable for syncing purposes like GMAIL. It's just hard to cut the cord. The man I was on the phone with knew of my problem, and he solved it by getting rid of AOL. It's just tough, since so many people have the e-mail address for me.
On http://mobile.aol.com/aolproducts/mobile-email/mail-client
there seems to be some indication when you click on Smart Phones on left, that Coming Soon is Palm, but I don't know if that's going to be downloadable for 700p, or Palms moving forward. Or how far away that is.
I tried wireless sync and hated it.
This is really a pain in the butt.
*** Who did you speak to at AOL?
*** How did you reach them? e-mail? phone #?
I also did a search and found another program called "Snappermail", which I might try, and see if it's any better than Chatteremail.
http://www.handango.com/SoftwareCatalog.jsp?jid=24BX5EEAD31DXE6AB588D59X31E95BD5&osId=904&siteId=1&N...
If you find anything out, please let me know here, ok? This is very bad for me.
Post relates to: Treo 700p (Verizon) -
In Apache, there's a Cron... but does it work with JSP? if it doesn't, is there any job scheduler for JSP?
tuckker wrote:
But if I call a JSP file from Cron??? Will Cron be able to process the JSP file/Well, let me ask you this, can you "call" a JSP file from command line? Okay then.
Now, if this "Cron" module operates by making (or simulating, if it is an Apache Web Server module) http connection to the server, then yes, it can, if not, then, as above, no it can't. -
I have recently upgraded my iMac Intel G5 iSight (iMac5,1) to OS 10.6.8 and now the internal mic does not work with skype or facebook. I can here static when playing back clips. Do I need to update firmware or reload old system parts. I have zapped PRAM. The blue indicator in system audio panel will appear for a second as I slide the bar for internal mic but then it disappears. Is there a fix?
The sound seems very faint but can here static on playback.
-
My operating system windows XP not working with photoshop cloud, why not?
I need to add 2 more licences for photoshop cloud and I'm being told my operating system windows XP does not work with Photoshop cloud. We already have 2 pcs using it in our office so why not?
Please help
RoyDo you have the latest version of iTunes? If not, get it at:
http://www.apple.com/itunes -
adobe creative cloud eea 1.5 is not working with our asus Eee box , celeron j1900 2.00 ghz, 4gb of ram, 64bit. can settings be changed in adobe?
A chat session where an agent may remotely look inside your computer may help
Creative Cloud chat support (all Creative Cloud customer service issues)
http://helpx.adobe.com/x-productkb/global/service-ccm.html
Maybe you are looking for
-
Hello, About a week or two ago, I noticed all my appointments were on my calendar a day early, as well as birthdays in my contacts. I sync my phone with my Macbook using Address Book and Calendar; had done this previous with my iPhone 3GS running iO
-
Setting time automatically doesn't work?
One of the less obvious new features in iOS 4.2 is that there is now an option in your Settings app to set the time automatically. The only problem with that option is that it doesn't work - at least not for me. Actually, what happens when I enable t
-
I am just bought new iPhone 5 a couple days ago in UAE.,Since I can use Facetime on UAE (there is no Facetime on my setting),, Is it possible to use it (Facetime) in Indonesia with my iPhone? Because my friend from indonesia posible from using it.
-
Business Groups and GL Responsibilities
We are performing a fresh install that will be utilizing Oracle HR and will require 3 business groups, multiple LE's, and multiple ledgers for different countries. Since responsibilities are assigned to employees that are linked to business groups...
-
Unable to locate custom themes in Keynote '09
I created some custom themes that I want to delete. I have been unable to locate them on my hard drive. The directions in the Keynote '09 User Guide don't point me to the right place. I found the stock themes in Applications> iWork'09> Keynote.app> C