Problem with a href tag in JSF

Hi,
I am developing an application in JSF, but facing a problem.
In the application where I am using <a> tag for example
, when I pressing this link each time I it adds faces/faces/faces to the link. e.g. faces/faces/faces/ads.jsp
How I can solve this pronlem, please guide me...
Thanks in advance

please explain better your problem.

Similar Messages

  • Problem with InputSelect Data Tag if there is no register in database

    Hello all,
    I4m working with Oracle JDeveloper 3.2.2 and I have a problem with InputSelect Data Tag.
    When I tried to access a JSP page with this object and there was n't a record at the table, an error occurred.

    All the input tags operate on rows in the cache. Prior to using the input tags, use the Row tag with the 'Create' option to make sure you have a valid row.

  • Weird problems with CSS being applied to JSF pages

    I have this really weird problem with my CSS rules being applied to my JSF pages. My CSS rules don't get applied unless one of the following two things happen:
    - A page is reloaded (by redirecting to itself, or if there were validation errors)
    - The previous page in the history had the same relative reference to the same CSS file.
    If a page is newly loaded, and the previous page did not have that same CSS reference, the CSS styles will not show up. Also, if the above is true, and the page is reloaded by JSF, the CSS styles show up.
    Now, my problem could be solved if I put all JSP files in the same level, but the display of the first page would still be without the CSS style applied.
    Is this known behaviour? And if it is, does it have anything to do do with the way JSF handles URLs (always one level back)? Help and input is kindly appreciated!

    Dude,
    I tried the same
    <link rel="stylesheet" href="<h:outputText value="#{facesContext.externalContext.requestContextPath}"/pages/css/default.css" />
    and I got the following Jasper exception.... pointers plz ??
    =============================================================
    2005-08-24 14:18:55,937 [http-8080-Processor25] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[mydemo].[FacesServlet] - Servlet.service() for servlet FacesServlet threw exception
    org.apache.jasper.JasperException: /myproj/eventCrit.jsp(8,78) Unterminated <h:outputText tag
         at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
         at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:130)
         at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1049)
         at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1367)
         at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1564)
         at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1793)
         at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1060)
         at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1367)
         at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1564)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
         at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
         at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
         at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    =========================================================

  • Can we  have a href tags in jsf page

    hi all,
    I tried inserting a link in jsf page using <a href> tag but when I click it, it is appending the link to contextroot.
    For Example:
    <f:verbatim>
    click here
    </f:verbatim>
    and when I click on it, I see http://www.google.com is appended to my application url after context root like
    http://localhost:9080/Ma/view/India/http://www.google.com
    and I get 404 error. how do I do it without having my application url.
    Thanks
    Ma
    Edited by: niki007 on Jan 12, 2009 4:32 PM

    This problem can occur if you didn't specify any protocol (http:// or https:// or others) in the link. But your example looks fine. I think that you modified the real code to this example, without being aware that you solved the problem yourself.
    At any way, you can also just use h:outputLink to render <a> elements.

  • 4.1.1 SDK Problems with missing xpacket tags in sidecar XMP files

    The current 4.1.1 SDK has problems with sidecar XMP files that don't have the xpacket headers and trailers, i.e:
    <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
    <?xpacket end='w'?>
    is missing. Now, unfortunately Adobe Bridge CS2/CS3 does not export these xpackets in sidecar XMP files.
    The standard, http://www.aiim.org/documents/standards/xmpspecification.pdf, is also very vague about it all:
    ● Write external metadata as though it were embedded and then had the XMP Packets
    extracted and catenated by a postprocessor.
    The grammar is strange(past tense had) and the spec implies that the xpacket should be extracted and again catenated... Someone should review this document and clearly state if xpacket statements should be in sidecar files or not. I suspect myself that they should be there, but the standard is very vague.
    Anyway, there are two places in the SDK code where changes might be needed:
    XMPFiles::Initialize has XMP_Asserts in case the xpacket header/trailer is missing, but the underlying assert is only active in debug builds.
    XMPScanner::PacketMachine::FindNextPacket () also has in its truth table the assumption that the xpackets exist.
    There could be even other places in the code that assumes that the xpacket tags are present in all files, which includes text XMP sidecar files.
    Anyway.
    a) Shouldn't bridge export the xpacket tags? Same with any other application?
    b) If the spec is vague, then the SDK should not assume that the xpacket tags are present.
    Any comments? Has someone already fixed this issue as I suspect a lot of apps using the the XMP SDK would break concerning reading XMP sidecar files? Thx, Kent

    I was able to work around the problem by creating a mapped view of the .xmp file (this creates an array in memory backed by the file on disk, so there's no need to read the file into a separate internal buffer), and constructing the SXMPMeta object directly from the buffer. (The ctor for that class calls ParseFromBuffer, so this is the same thing as was suggested by other messages in this thread.)
    It seems that Adobe needs to do one of these things:
    (1) say that Bridge CS3 has a bug, and agree that Bridge CS3 should include a proper xpacket header when writing xmp sidecar files
    (2) say that the XMP Toolkit has a bug, and that the SDK should be able to parse sidecar files without an xpacket header, and agree to fix the toolkit
    (3) say that Bridge CS3 and the XMP Toolkit behave as expected, but then provide a sequence of steps by which users of the XMP Toolkit are expected to read xmp sidecar files written by Bridge CS3
    Does Bridge CS4 write an xpacket header to the xmp sidecar files?
    Maybe what I could do is create a custom file handler for .xmp sidecar files, so I could use the SXMPFiles for everything, instead of having to special-case .xmp files.
    My needs are pretty modest though, and it might be just as simple to use the MS DOM-based XML parser for load the xmp sidecar file. I bet I could get the data I need (only the "Rating" for now) using a simple XPath expression.
    -Matt

  • [JS CS3] Problem with iterating xml tags

    Hello,
    Below is a script that is supposed to find text in a document and then tag it with an xml tag. I have run into a problem, which if I solve in the way I know how, causes another problem.
    When I iterate in a positive direction--i++--the first instance of the text (in this example "abc") is correctly tagged. But the second instance the tag recedes by two characters, that is, tags the three characters prior to the "c." A third instance will recede two more characters, ad nauseam, if my Latin is correct.
    The solution is to iterate backwards, i.e., i--. But this causes another problem. If there is more than one story, then the xml structure reverses the order of the stories. The elements within a story are ordered correctly however.
    So why is this happening and how can I solve it?
    Thanks,
    Tom
    var myDoc = app.activeDocument;
    var findABC = theTextFinder(myDoc,"abc");
    xmlTagIt(myDoc,"abc",UIColors.RED,findABC);
    //*****functions*******
    function xmlTagIt(docRef, tagName,colorOfTag, arrToTag){
        var tagName, colorOfTag,  arrToTag;
        myDoc.xmlViewPreferences.showStructure = true;
        myDoc.xmlViewPreferences.showTaggedFrames =true;
        myDoc.xmlViewPreferences.showTagMarkers = true;
        myDoc.xmlViewPreferences.showTextSnippets =false;
        myDoc.xmlPreferences.defaultStoryTagColor = UIColors.WHITE;
        var rootElement = myDoc.xmlElements.item(0);
        if (myDoc.xmlTags.item(tagName) == null) {
            var tagRef = myDoc.xmlTags.add(tagName, colorOfTag);
      } else {//if tag already exists then stop the script. Avoid double tagging
           myDoc.xmlViewPreferences.showStructure = true;
           alert("You have already run this script.");
           exit();
       }//end else
        //for (var i = arrToTag.length-1; 0 <= i; i--){
        for (var i = 0; i <= arrToTag.length-1;  i++){
            var elementRef = rootElement.xmlElements.add (tagRef,arrToTag[i]);       
         }//end for i
    }//end function xmlTagIt
    function theTextFinder(docRef,textFindIt){//last argument is the string of text to find
        app.findTextPreferences = NothingEnum.NOTHING;
        app.changeTextPreferences = NothingEnum.NOTHING;
        app.findTextPreferences.findWhat = textFindIt;
        var arrTextFindIt = myDoc.findText();
        return arrTextFindIt;
    }//end theTextFinder

    Dave,
    Thanks for the reply.
    I'm not sure what you mean by "convert the references on the fly." You mean find a way to advance two characters forward and tag that? In the script I submitted here I am only searching for "abc," which of course I would not search or at all  in real life. The script uses grep to search for about twenty different typographical errors that typically appear and tags them all.
    Reiterating backwards seems, at first sight the way to go. But I haven't a clue as to how to reverse the order of the stories. I can get an array of stories, and array.reverse() them, but am not sure how to then make the script put this reversed order into the xml structure. Any hints?
    There, of course is bigger problem with the stories. If the document is written with one story created after another then the order of them is top to botom. But if say a text frame edited into the middle of all this, that story is still the last one in the xml structure. At least in one test, that was so. Maybe the way to solve this is to build an array of stories that have as one xml attribute the page it first appears on. Then order the array according to that attribute.
    Any advice you give will be appreciated.
    Thanks,
    Tom

  • Problem with location.href

    hi
    I want to create a widget but got a problem with a link. This is the html code.
    <body>
    <input type="text" id="temporaryinbox_textbox">
    <select id="language">
    <option value="">en</option>
    <option value="de/">de</option>
    <option value="es/">es</option>
    <option value="it/">it</option>
    </select>
    <input type="submit" value="Check" onclick="location.href = 'http://www.temporaryinbox.com/' + document.getElementById('language').value + 'inbox.php?inbox=' + document.getElementById('temporaryinbox_textbox').value;">
    <input type="submit" value="Random email" onclick="createRandomEmail();">
    <input type="text" id="temporaryinbox_textbox2" size="25" onclick="document.getElementById('temporaryinbox_textbox2').select();">
    </body>
    On Windows with Firefox it works but on OS X as a widget it loads the target in to the widget. How can I make load it into a new Safari window? Or set it, that the default browser will be used….
    Thanks for your help
    iMac Intel 17"   Mac OS X (10.4.6)  

    Hi Samira,
    DI has by nature some constraints, one is its memory leaks another one is the time of instanciation... I can keep going with some others like memeory consumption and not thread safe.
    Servers technologhies are, starting by the historical one DI-Server and its companion which is B1WS and finishing by one which is the way to go: B1if (you can call scenario as web services).
    What I meant by implementing a connection's cache mechanism, is to limit the number of connections and deconnections (the main issue with DI-API), but definitively I would try to go outside of this... But this is my personal point.
    Regards,
    Eric

  • Problem with logic:equal tag when used with bean:write

    Hi All,
    I have a problem with logic:equal.When i tried to use the following piece of code its not working
    <logic:equal name="var in session" value="<bean:write name='var in request'/>">
    Do some thing
    </logic:equal>
    its not working i know we cant use nested tags
    is thr any alternative instead of using a scriplet

    A scriptlet expression is about all you can do.
    <bean:define id="tempVar" name="var in request"/>
    <logic:equal name="var in session" value="<%= tempVar %>">
    ...If you have a JSP2.0 container with EL enabled, then you could use an EL expression instead of the standard <%= expr %>

  • Initial problem with JSP Custom Tag devolopment

    Hi ,
    I have encountered a problem with my JSP application which utilizes a simple custom tag.
    First I created followinng directories.
    1. %TOMCAT_HOME%\webapps\testTags
    2. %TOMCAT_HOME%\webapps\testTags\META-INF
    3. %TOMCAT_HOME%\webapps\testTags\WEB-INF
    4. %TOMCAT_HOME%\webapps\testTags\WEB-INF\tlds
    5. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes
    6. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com
    7. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com\tek271
    8. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com\tek271\testTags
    I created the essential four files, that is named as follows.
    1.TagError.java
    2.web.xml
    3.testTld.tld
    4.testJsp.jsp
    Then i put the files under these directories as given below
    testJsp.jsp under %TOMCAT_HOME%\webapps\testTags.
    web.xml under %TOMCAT_HOME%\webapps\testTags\WEB-INF
    TagError.java under %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes
    TagError.class under %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com\tek271\testTags
    testTld.tld %TOMCAT_HOME%\webapps\testTags\WEB-INF\tlds
    Here is the content inside the files.
    1.TagError.java
    package com.tek271.testTags;
    import java.io.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class TagError extends TagSupport {
    private String mColor = "red";
    public void setColor(String aColor) {
    mColor = aColor;
    } // setColor
    public int doStartTag() throws JspException {
    try {
    JspWriter out = pageContext.getOut();
    out.print("<font color=\"");
    out.print(mColor);
    out.print("\"><b>Error: ");
    } catch (IOException ex) {
    throw new JspTagException(ex.getMessage());
    return EVAL_BODY_INCLUDE; // other return: SKIP_BODY
    } // doStartTag()
    public int doEndTag() throws JspException {
    try {
    JspWriter out = pageContext.getOut();
    out.println("</b></font><br>");
    } catch (IOException ex) {
    throw new JspTagException(ex.getMessage());
    return EVAL_PAGE; // other return: SKIP_PAGE
    } // doEndTag()
    } // TagError
    2.web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app>
    <taglib>
    <taglib-uri>/testTaglib</taglib-uri>
    <taglib-location>/WEB-INF/tlds/testTld.tld</taglib-location>
    </taglib>
    </web-app>
    3.testTld.tld
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
    "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>testTld</shortname>
    <info>Testing jsp tags</info>
    <tag>
    <name>tagError</name>
    <tagclass>com.tek271.testTags.TagError</tagclass>
    <bodycontent>JSP</bodycontent> <!-- Also: empty, tagdependent -->
    <info>Show a string as an error message</info>
    <attribute>
    <name>color</name>
    <required>false</required>
    </attribute>
    </tag>
    </taglib>
    4.testJsp.jsp
    <%@ taglib uri="/testTaglib" prefix="test" %>
    <html>
    <head>
    <title>Testing Tag Library</title>
    </head>
    <body>
    <test:tagError>Invalid user name</test:tagError>
    <test:tagError color="blue">Invalid Password</test:tagError>
    </body>
    </html>
    but i am getting the following error.
    Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: File "/testTaglib" not found
    at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:214)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:174)
    at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirective(JspParseEventListener.java:1162)
    at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:758)
    at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:121)
    at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:255)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:1099)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:213)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
    at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
    at java.lang.Thread.run(Thread.java:536)
    why is it like this ?please give me a solution.
    Thanking in advance.
    From
    Vinod A.

    Dear patreck ,
    It does not work.
    I have replaced the line
    <%@ taglib uri="/testTaglib" prefix="test" %>
    with
    <%@ taglib uri="WEB-INF/tlds/testTaglib" prefix="test" %>
    but now it shows the error ,
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: File "/testTags/WEB-INF/tlds/testTaglib" not found
    any more suggestion ?
    From Vinod A.

  • Problem with email being tagged as spam

    We recently changed our ISP, and up to this point we had no problems with emails to partners being tagged as spam. I've setup the send and receive connectors as the public FQDN, but we're seeing the following NDR:
    p01c12m113.mxlogic.net #554 Denied[CS] [50e56f35.0.4929.00-2377.9578.p01c12m113.mxlogic.net]
    (Mode: normal) ##
    I've emailed McAfee to see what the problem is, but I haven't heard back. When I do a query on their web site, the web interface doesn't indicate there is a problem with this mail server, but it's continued to reject messages today. Even though the send
    and receive connectors are set to mail.domain.com, but there still a portion of the header with the domain.local. I'm wondering if that might be causing a problem. Can anyone help me out here? Thank you.
    Return-path: <[email protected]>
    Envelope-to: [email protected]
    Delivery-date: Thu, 21 Aug 2014 16:16:30 -0500
    Received: from mail.domain.com ([68.106.69.243]:51586)
    by server.rcvdomain.com with esmtps (TLSv1:AES128-SHA:128)
    (Exim 4.82)
    (envelope-from <[email protected]>)
    id 1XKZiX-00065C-Kj
    for [email protected]; Thu, 21 Aug 2014 16:16:21 -0500
    Received: from server.domain.local ([fe80::69d5:9cfa:1b4e:dfa3]) by
     server.domain.local ([fe80::69d5:9cfa:1b4e:dfa3%10]) with mapi id
     14.01.0438.000; Thu, 21 Aug 2014 16:16:21 -0500
    From: User <[email protected]>
    To: "[email protected]" <[email protected]>
    Subject: Help
    Thread-Topic: Help
    Thread-Index: Ac+9hSb9q5a7FGZpQG2YPEX62Lunhw==
    Date: Thu, 21 Aug 2014 21:16:20 +0000
    <o:p></o:p>

    ok lets start one by one.. to rule out the problem with your Email system go to www.testexchangeconnectivity.com and perform the exchange tests like inbound/ outbound and other relevant tests and share the results. once this is confirmed then come to Mcafee
    Let me know which Exchange and which Mcafee versions you are using as i also have Mcafee and it needs some tuning. May be i can help you. but need to know the info and if you can paste a NDR which are tagged as SPAM
    MARK AS USEFUL/ANSWER IF IT DID
    Thanks
    Happiness Always
    Jatin

  • Problem with reading MP3 tag information

    This may be a simple fix, but I'm having no luck figuring it out. I've got an application here that scans through a given directory for all files. We are going to assume that all files below the given parent directory are *.mp3 files. Every file we find is going to have its path stored into an ArrayList. After the ArrayList is created, we will then through the ArrayList, getting the String value which is a path to our MP3 file.
    The application works well when I am simply printing out the ArrayList to the console. It's printing out everything in the ArrayList. The ArrayList consists of both directories and paths to actual files. The problem comes when I am trying to take the String from the ArrayList, pass it into my getID() method. Here is the code. i've commented the line in my main method that is giving me problems.
    * Main.java
    * @author tristan
    * Created on August 7, 2007, 4:26 PM
    package audioidreader;
    import java.io.*;
    import java.util.*;
    import org.blinkenlights.jid3.*;
    import org.blinkenlights.jid3.v1.*;
    import org.blinkenlights.jid3.v2.*;
    public class Main
        /** Creates a new instance of Main */
        public Main ()
         * @param args the command line arguments
        public static void main (String[] args) throws Exception
            /* tempDir is the directory where we will be searching for files. The ArrayList 'files'
             * is where all the file listings will be stored by using getFileListing(tempDir). The
             * for() loop get the size of the ArrayList, starts from the first index, and gets the
             * index value. The index values are supposed to be paths to an MP3 file. We will use
             * System.out.println() to print out all the paths to all the MP3s found to the console.
            File tempDir = new File ("/home/tristan/My Music");
            ArrayList files = (ArrayList) getFileListing ( tempDir );
            for(int i = 0; i < files.size (); i++)
                System.out.println ( files.get (i) );
                // getID((String) files.get (i)); // throws an exception
        static public ArrayList getFileListing ( File aStartingDir ) throws FileNotFoundException
            /* First, we check to see if our directory for the MP3s exists or not. In this case,
             * we are calling validateDirectory() with a file object passed from our main method.
             * If the directory is good, we then create a new Arraylist to store the results in.
             * We then scan through our directory and find every file within our parent directory
             * and we add the result, even directories, to the ArrayList. Once everything is done,
             * we return the 'result' ArrayList to where it was originally called from Main.
            validateDirectory (aStartingDir);
            ArrayList result = new ArrayList ();
            File[] filesAndDirs = aStartingDir.listFiles ();
            List filesDirs = Arrays.asList (filesAndDirs);
            Iterator filesIter = filesDirs.iterator ();
            File file = null;
            while ( filesIter.hasNext () )
                file = (File)filesIter.next ();
                result.add (file);
                if (!file.isFile ())
                    List deeperList = getFileListing (file);
                    result.addAll (deeperList);
            Collections.sort (result);
            return result;
        static private void validateDirectory (File aDirectory) throws FileNotFoundException
            /* This method checks to see if our parent directory that we entered is an existing
             * directory. If the directory does not validate, we will throw an exception specific
             * to the reason of not being valid.
            if (aDirectory == null)
                throw new IllegalArgumentException ("Directory should not be null.");
            if (!aDirectory.exists ())
                throw new FileNotFoundException ("Directory does not exist: " + aDirectory);
            if (!aDirectory.isDirectory ())
                throw new IllegalArgumentException ("Is not a directory: " + aDirectory);
            if (!aDirectory.canRead ())
                throw new IllegalArgumentException ("Directory cannot be read: " + aDirectory);
        static private void getID (String mp3) throws ID3Exception
            /* getID() is called by the main method. What we are attempting to do here is
             * receive the String (path to MP3 file) that is passed to us and do a test on
             * it. First, we will use the String to our MP3 and make it a file object.
             * After creating the file object, we are then using that object to create
             * an MP3 object. Now, we will read the tages from the object to determine
             * if it is an ID3 v1.0 or ID3 v2.3.0 tag. Regardless of what it is, we want to
             * print out some information to the console in the format of 'Artist - Title'.
            File oSourceFile = new File (mp3);
            MediaFile oMediaFile = new MP3File (oSourceFile);
            ID3Tag[] aoID3Tag = oMediaFile.getTags ();
            for (int i=0; i < aoID3Tag.length; i++)
                if (aoID3Tag[i] instanceof ID3V1_0Tag)
                    ID3V1_0Tag ID3_1 = (ID3V1_0Tag)aoID3Tag;
    if (ID3_1.getTitle () != null && ID3_1.getArtist () != null)
    System.out.println (ID3_1.getArtist () + " - " + ID3_1.getTitle ());
    else if (aoID3Tag[i] instanceof ID3V2_3_0Tag)
    ID3V2_3_0Tag ID3_2 = (ID3V2_3_0Tag)aoID3Tag[i];
    if (ID3_2.getArtist () != null && ID3_2.getTitle () != null)
    System.out.println (ID3_2.getArtist () + " - " + ID3_2.getTitle ());
    If I type in an actual String that is a path to an MP3, such as:
    getID("/home/tristan/My Music/Incubus - Drive.mp3"); Everything works fine. I've tried casting the value pulled from the ArrayList as a String and then passing it to the getID() method, but my exception I am getting is:
    Exception in thread "main" java.lang.ClassCastException: java.io.File cannot be cast to java.lang.String
            at audioidreader.Main.main(Main.java:38)
    Java Result: 1Line 38 is the line I have commented out. Any ideas?

    You're right. That is a bit misleading. Anyway, I
    decided to not cast (String) to it. It was a simple
    fix just like I figured, but of course I figure it
    out after I made the post.
    getID (files.get (i).toString ());fixed my problem. Thank you.But not in the correct way. You should really use the canonical path or the absolute path.

  • Problem with EL (forEach) in Facelets + JSF 1.2

    I am trying to upgrade my application from JSF 1.1 to JSF 1.2. However, I have run into a problem that I can't quite grasp.
    I have a backing bean with the following method
    public List<String> getFoos() {
    return foos;
    With JSF 1.1 + Facelets the following EL worked fine
         <c:forEach var="foo"
              items="${page.foos}">
              #{foo}
         </c:forEach>
    However, once I upgraded to JSF 1.2 suddenly this EL resolves to nothing. In fact, my getFoos() method on my backing bean is not even called. I have googled around but I cannot seem to find what changed in JSF 1.2 that would break this.
    If anyone has any ideas, your help is greatly appreciated.
    Thanks,
    Randy

    I have had problems using Java v8 with CUC. I had to go back to Java v7 to use the Media Master bar. Works fine now.
    If that doesn't work you could set up a Greetings Administrator call handler to record the greetings. You could even set up a hidden option to press * (or any digit) from your existing call handler to transfer to the Greetings Administrator call handler. Just need to set an owner for the call handler you want to record the greetings for (Edit/Call Handler Owner), then call the original call handler, press *, put in the username (VM extension), VM password and extension of the call handler you want to record.

  • Problem with opening PDF files from JSF page using SDO

    Hi all,
    I'm new with JSF and was attempting to read a PDF file from a Database using SDO and JSF. The code below throws an exception when casting from DataObject to Blob. The getLcDoc() method was created by WSAD when I dragged an SDO relational record onto the JSF page. This method returns an DataObject type which I tried casting to a Blob type before using it further. However, an exception is thrown.
    Any feedback is appreciated.
    Arv
    try {
                   FacesContext faces = FacesContext.getCurrentInstance();
                   HttpServletResponse response =(HttpServletResponse) faces.getExternalContext().getResponse();
                   Blob file= (Blob)getLcDoc().get("ATTACH");
                   int iLength = (int)(file.length());
                   response.setHeader("Content-type", "application/pdf");
                   response.setHeader("Content-Disposition", "inline; filename=Attachment");
                   response.setHeader("Expires","0");
                   response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
                   response.setHeader("Pragma","public");
                   response.setContentLength(iLength);
                   ServletOutputStream os = response.getOutputStream();
                   InputStream in = null;
                   in = file.getBinaryStream();
                   byte buff[] = new byte[1024];
                   while (true) {
                   int i = in.read(buff);
                   if (i<0) break;
                   os.write(buff,0,i);
                   os.flush();
                   os.close();
         } catch(Exception ex){
              System.out.println("Error while reading file : " + ex.getMessage());
         }

    Hi...I found out that there is actually no need to use a Blob object at all. You can simply call the OutputStreams write() method and pass the DataObject.getBytes() method that returns a byte[] array. The revised code is shown at the end of this posting.
    However, a few other teething problems exist:
    1. This works well only if I specify the content type in response.setHeader() method. What if my users upload different types of files, is there a way that the browser opens according to the file type without setting the content type?
    2. I still have a problem opening PDF files, even if I specify - response.setHeader("Content-type", "application/pdf");
    I get the message - The file is damaged and could not be repaired
    3. I would also like this to open the attachment in a new window and using target="_blank" doesn't seem to work as seen below:
    <h:commandLink
                                                 styleClass="commandLink" id="link1" action="#{pc_DocumentDetailsRead.doLink1Action}" target="_blank">
                                                 <h:outputText id="text5" styleClass="outputText"
                                                      value="Click Here"></h:outputText>
                                            </h:commandLink>
    ------------------------Revised code-----------------------------------------
    FacesContext faces = FacesContext.getCurrentInstance();
                   HttpServletResponse response =(HttpServletResponse) faces.getExternalContext().getResponse();
                   response.setHeader("Content-type", "application/msword");
                   response.setHeader("Content-Disposition", "inline; filename=Attachment");
                   response.setHeader("Expires","0");
                   response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
                   response.setHeader("Pragma","public");
                   ServletOutputStream os = response.getOutputStream();
                   os.write(getLcDoc().getBytes("ATTACH"));
                   os.flush();
                   os.close();

  • Problem with server side state saving ,JSF 1.1.1

    Hello,
    In my web.xml  the.STATE_SAVING_METHOD setting is s server
    <context-param>
            <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
            <param-value>server</param-value>
        </context-param>
    for measurement of application security isn't not allow to change this parameter to client , so the problem  when i access for application and i open a new page via linker for print for example and i would access for my initial page to make change or modify my initial page it s no possible to make any modification because i have a empty bean , but if the state saving is a client i haven't a problem because a tree map is stored in client browser, so my version of JSF is 1.1.1 ,
    So can you explain the cause for his problem
    and what's the solution for my problem ?
    NB:i can't change the parameter for STATE_SAVING_METHOD for a client
    Thank you

    did you search this form, there were lot of discussions in the past about server side cookies, you may find an answer to your problem.
    alternate approache for sending a value from parent page to the pop up window.
    1. when opening the pop up pass the values along with the url (if the size of variable is small)
    alternatively you can store the value in a hidden form field in parent window and access the same from poup window using
    you can simple access the page one form field value in page 2 (pop up) by using the following code.
    window.opener.document.getElementById('hiddenformfieldid').value

  • Problems with custom JSP Tag, can someone offer some advice?

    Greetings,
    I have a problem here that I am stumped on. I am trying to create a custom JSP tag, I created a simple "Hello World" JSP, however, I am coming up a bit short. I am running Apache Tomcat 6.0 on a Win XP environment.
    The code I have is as follows:
    TLDTest.tld:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
    "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_2.dtd">
    <taglib>
         <tlibversion>1.0</tlibversion>
         <jspversion>1.2</jspversion>
         <shortname>firstTag</shortname>
         <info>My First Tag</info>
    <!-- Here goes nothing!!! -->
    <tag>
         <name>hola</name>
         <tagclass>Hola</tagclass>
         <bodycontent>empty</bodycontent>
         <info>a simple hello tag</info>
    <!-- attributes -->
    <!-- Personalize the name -->
    <attribute>
         <name>name</name>
         <required>false</required>
         <rtexpvalue>false</rtexpvalue>
    </attribute>
    </tag>
    </taglib>
    The Hola.jsp is:
    <%@ taglib uri="/Hola" prefix="test" %>
    <html>
         <head>Just a little test on tags</head>
         <body>
              <hr />
              <test:Hola name="Woot Master" />
              <hr />
         </body>
    </html>
    And the source code for the .class file (named Hola) is:
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class Hola extends TagSupport
         private String name = null;
         public void setName(String value)
              name = value;
         public String getName()
              return(name);
    /* doStartTag is called and defined below here for the java tag */
         public int doStartTag()
              try
                   JspWriter out = pageContext.getOut();
                   out.println("<table border=1>");
                        if (name != null)
                             out.println("<tr><td> Hola " + name + "!" + "</td></tr>");
                        else
                             out.println("<tr><td> Hola! Porque tu es una piquito perra? </td></tr>");
              catch (Exception ex)
                   throw new Error("Dio's Mio!, Esta No Va!, tu problema es en la StartTag!!!");
              return SKIP_BODY;
    /* doEndTag is defined here. */
         public int doEndTag()
              try
                   final JspWriter out = pageContext.getOut();
                   out.println("</table>");
              catch (final Exception ex)
                   throw new Error("Oops, it's broken, check your coding in the End tag!!!");
    What I keep getting is the following error:
    org.apache.jasper.JasperException: /Hola/Hola.jsp(6,2) No tag "Hola" defined in tag library imported with prefix "test"
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:198)
    I've been back and forth on this, but I am lost. Obviously I am missing something, but what is it? It wouldn't be in the web.xml file would it? I am running a vanilla tomcat install. Any help that anyone can provide would be greatly appreciated.
    Sincerely,
    - Josh

    Ok
    1 - In the JSP, your tag should be "hola" not "Hola". Yes case matters.
      <test:hola name="Woot Master" />2 - Importing the taglibrary correctly.
    Either reference its tld <%@ taglib uri="/WEB-INF/Hola.tld" prefix="test" %>
    (and have the tld file sitting in /WEB-INF/Hola.tld )
    or
    Define a uri for it in the tld...
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.2</jspversion>
    <shortname>firstTag</shortname>
    <uri>http://mytag/hola</uri>
    ...and then use that uri to import it in your JSP
    <%@ taglib uri="http://mytag/hola" prefix="test" %>
    3 - Put your tag class in a package. Classes not in packages have a way of not being found.
    package mypackage
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class Hola extends TagSupport {
    ...That will move it in your folder structure to be /mypackage/Hola.java
    You would also need to update the tagclass element in the tld to reflect the change:
    <tagclass>mypackage.Hola</tagclass>4 - Mistake in your tld: You are missing an "r" in "rtexprvalue". <rtexpvalue> should be <rtexp*r*value>
    5 - In your Tag class, you should return something from the "doEndTag()" method.
    return super.doEndTag(); or maybe return EVAL_PAGE;
    Revised code:
    WEB-INF/hola.tld
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
    "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_2.dtd">
    <taglib>
         <tlibversion>1.0</tlibversion>
         <jspversion>1.2</jspversion>
         <shortname>firstTag</shortname>
         <uri>http://mytag/hola</uri>
         <info>My First Tag</info>
         <!-- Here goes nothing!!! -->
         <tag>
              <name>hola</name>
              <tagclass>mypackage.Hola</tagclass>
              <bodycontent>empty</bodycontent>
              <info>a simple hello tag</info>
              <!-- attributes -->
              <!-- Personalize the name -->
              <attribute>
                   <name>name</name>
                   <required>false</required>
                   <rtexprvalue>false</rtexprvalue>
              </attribute>
         </tag>
    </taglib>hola.jsp:
    <%@ taglib uri="http://mytag/hola" prefix="test"%>
    <html>
      <head>Just a little test on tags</head>
      <body>
        <hr />
        <test:hola name="Woot Master" />
        <hr />
      </body>
    </html>Hola.java. Compiles into WEB-INF/classes/mypackage/Hola.class
    package mypackage;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class Hola extends TagSupport {
         private String name = null;
         public void setName(String value) {
              name = value;
         public String getName() {
              return (name);
         /* doStartTag is called and defined below here for the java tag */
         public int doStartTag() {
              try {
                   JspWriter out = pageContext.getOut();
                   out.println("<table border=1>");
                   if (name != null)
                        out.println("<tr><td> Hola " + name + "!" + "</td></tr>");
                   else
                        out.println("<tr><td> Hola! Porque tu es una piquito perra? </td></tr>");
              } catch (Exception ex) {
                   throw new Error("Dio's Mio!, Esta No Va!, tu problema es en la StartTag!!!");
              return SKIP_BODY;
         /* doEndTag is defined here. */
         public int doEndTag() {
              try {
                   final JspWriter out = pageContext.getOut();
                   out.println("</table>");
                   return super.doEndTag();
              } catch (final Exception ex) {
                   throw new Error("Oops, it's broken, check your coding in the End tag!!!");
    }Cheers,
    evnafets

Maybe you are looking for