Problems with filters and jsp pages.

I have the following simple filter that checks if there is user information in the session object and redirects accordingly:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class LoginFilter implements Filter
     public void init(FilterConfig filterConfig) {}
     public void destroy() {}
     public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
     throws IOException, ServletException
          System.out.println("filter");
          HttpSession session = ((HttpServletRequest)request).getSession();
          String action = request.getParameter("action");
          if(action != null && !action.equals("login") && !action.equals("wronglogin"))
               if(session.getAttribute("username") == null)
                    ((HttpServletResponse)response).sendRedirect("index.jsp?action=wronglogin");
                    System.out.println("User not OK, kicking out...");
               else
                    chain.doFilter(request, response);
                    System.out.println("User OK, letting in...");
          else
               chain.doFilter(request, response);
}The filter is mapped to an admin page with the name index.jsp. However, I get an error for every <% and %> tag in the file (there are quite a few) when I use the filter with the page. The page works fine without the filter, and the filter seems to work with pages without scriptlets (without the <% and %> tags). Here is the beginning of the error report:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 6 in the jsp file: /admin/index.jsp
Generated servlet error:
Syntax error on tokens, AnnotationName expected instead
An error occurred at line: 6 in the jsp file: /admin/index.jsp
Generated servlet error:
Syntax error on tokens, delete these tokens
An error occurred at line: 6 in the jsp file: /admin/index.jsp
Generated servlet error:
Syntax error on token ";", [ expected
An error occurred at line: 6 in the jsp file: /admin/index.jsp
Generated servlet error:
Syntax error on token ";", [ expected
An error occurred at line: 6 in the jsp file: /admin/index.jsp
Generated servlet error:
Syntax error on token ";", [ expected
Jasper gives me many errors per <% and %> tag. As you can see there is a <% tag on line 6. Any idea, why this does not work?
Thanks!
Message was edited by:
chincillya

What is the JSP scriptlet code at line 6 ?
By looking at the code we can identify if there are any syntax errors, otherwise we can't really guess what might be the problem.

Similar Messages

  • Problem with JNDI and JSP in Tomcat

    Hi,
    Basically, what I've done is to use the Tomcat administration web
    application to create the DataSource, which looks like it populated the
    server.xml (see below). I then try to access the testconn.jsp, and am
    getting that "Name java:comp is not bound in this Context" error.
    I was wondering if anyone could tell me what I'm doing wrong?
    Thanks,
    Feri
    My Configuration:
    - Tomcat 5.0.19
    - MySQL 4.0.18-nt
    - mysql-connector-java-3.0.15-ga-bin.jar
    server.xml:
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <!-- Editable user database that can also be used by
    UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    <!--Feri test JNDI-->
         <Context crossContext="true" debug="5" docBase="injury" path="/injury" reloadable="true">
         <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_injury_log." suffix=".txt" timestamp="true"/>
              <Resource name="jdbc/injury" auth="Container"
    type="javax.sql.DataSource">
    </Resource>
    <ResourceParams name="jdbc/injury">
         <parameter>
              <name>factory</name>
              <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
         </parameter>
    <parameter>
    <name>username</name>
    <value>root</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>root</value>
    </parameter>
         <parameter>
    <name>driverClassName</name>
    <value>com.mysql.jdbc.Driver</value>
    </parameter>
         <parameter>
    <name>url</name>
    <value>jdbc:mysql://localhost:3306/injury</value>
    </parameter>
         <parameter>
              <name>maxIdle</name>
              <value>30</value>
         </parameter>
         <parameter>
              <name>maxActive</name>
              <value>10</value>
         </parameter>
         <parameter>
              <name>maxWait</name>
              <value>10000</value>
         </parameter>
    </ResourceParams>
         </Context>
    <!--Feri test JNDI end-->
    </GlobalNamingResources>
    \webapps\injury\WEB-INF\web.xml:
    <resource-ref>
    <description>Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file.</description>
    <res-ref-name>jdbc/injury</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    \webapps\injury\testconn.jsp
    <%@ page import="java.sql.*" %>
    <%@ page import="javax.sql.*" %>
    <%@ taglib prefix="ct" uri="/injury" %>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
    <h1>Connection test</h1>
    <ct:connection name="jdbc/injury">
    <%
    Statement stmt= conn.createStatement();
    ResultSet rs;
    rs = stmt.executeQuery("select * from user");
    while (rs.next()){
    %><%=rs.getString(1)%><%=rs.getInt(2) %><br><%
    rs.close();
    stmt.close();
    %>
    </ct:connection>
    ConnectionTag.java
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import javax.naming.*;
    import javax.sql.*;
    import javax.sql.DataSource;
    public class ConnectionTag extends TagSupport implements TryCatchFinally {
    private Connection conn;
    // JNDI name of the connection
    private String name;
    public void setName(String name)
         this.name = name;
    public int doStartTag()
         throws JspException
         try {
         Context env = (Context) new InitialContext().lookup("java:comp/env");
         DataSource ds = (DataSource) env.lookup(name);
         if (ds != null)
              conn = ds.getConnection();
         } catch (Exception e) {
         throw new JspException(e);
         if (conn == null)
         throw new JspException("can't open connection " + name);
         pageContext.setAttribute("conn", conn);
         return EVAL_BODY_INCLUDE;
    public void doCatch(Throwable t)
         throws Throwable
         throw t;
    public void doFinally()
         try {
         Connection conn = this.conn;
         this.conn = null;
         pageContext.removeAttribute("conn");
         conn.close();
         } catch (Exception e) {
    Tomcat 5.0\conf\Catalina\localhost\injury.xml
    <?xml version='1.0' encoding='utf-8'?>
    <Context displayName="Injury" docBase="E:\Tomcat 5.0\webapps\injury" path="/injury" className="org.apache.catalina.core.StandardContext"
    cachingAllowed="true" charsetMapperClass="org.apache.catalina .util.CharsetMapper" cookies="true" crossContext="false" debug="0"
    mapperClass="org.apache.catalina.core.StandardContextMapper" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper" >
    <Resource auth="Container" description="Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file." name="jdbc/injury" type="javax.sql.DataSource"/>
    <ResourceLink global="jdbc/injury" name="injury" type="javax.sql.DataSource"/>
    </Context>

    Hi,
    First of all, you can find alot of information about this in the forum about jsp's.
    I think a good thing to do is not to put your context tag directly into the server.xml file.
    What you should do is create a context.xml file with the context-tag in it, and put it in the META-INF directory of your .war file. Upon deployment to tomcat5 this file will be extracted from the war, copied to the conf\enginename\hostname directory, and it will be renamed to contextName.xml.
    I think you are developing directly into the webapps directory, and I believe you should avoid that and use the deployment feature of the manager web-app or you should use the deployertool from you ide or standalone ant.
    anyway, for starters try to remove the context tag from the server.xml file as described above, and check out the jsp / jdbc forums for simular problems and answers.
    good luck

  • Problem with onload in jsp page

    Hi all,
    I had two jsp pages, a search and a results page. I need to enter some search criteria in the first page and based on that criteria i will be getting the results in the results jsp. Now, when i click the back button in the results page, i need to go to the search page and the values which i entered in the search page needs to be present there. But the problem is i had a javascript function which runs on loading of the search page. This function will set all the values in this search page to empty whenever we go to the search page. I am calling this javascript function as follows in my search jsp page.
    <body onload="setdefaultvalues('<%=name%>');">
    I am having the code for the back button in the results page as follows.
    <INPUT TYPE="button" VALUE='Back' onClick="javascript:history.go(-1);resetvalue(name);" class="button">
    The problem i am facing is whenever i go to the search page by clicking on the back button, the values in the search page are getting empty because of the onload method. There is no way that i can remove this onload method as i require it for setting the values in the search page evrytime i get to that from other modules as it is the main page for my module. So, is there anyway that i can stop this function from executing when i come from the results page or is there any other way that i can store the values in the search page when going from the results page.

    i think you really should have the result page include your search page contents rather than having the user need to click back as you'll end up with all sorts of nightmares in caching & session object management to be honest. if the search page is complex use javascript to hide contents and let the users expand them when they want to re-search.
    however, if you feel you must i would suggest the following:
    in your result page:
    session.setAttribute("userQuery","true"); (you probably actually want to put a container object with the query information in here)
    in your search page you could have something like:
    <body <% session.getAttribute("userQuery")==null { %>onload="setdefaultvalues('<%=name%>');"<% } %>>
    -or-
    <body onload="setdefaultvalues('<%=name%>',<%=session.getAttribute("userQuery")==null?"true":"false"%>);">
    function setdefaultvalues(name,run) { if ( !run ) return;....}
    you'll have to decide when to remove the object though cause once its set its there until the session expires or you remove it.
    hope that helps, good luck!

  • Connecting databeses with WML and JSP pages..!

    I need information about how to connect databases with wap technologies using wml and jsp , I am waiting your resources, codes and helps.. And I would like to remind you , I am beginner about this topic , Only things that I know are Jsp and WML , I have no experience about wap and how to combine wml and jsp , So please be helper while you send your messages , If all your messages contains much detailed and supported complete sources and files , it will more helpfull for me ..
    Thanks in Advance.
    P.S : 1- ) if you want to contact direclty , mail address : [email protected]
    2-) Don't post me complex references' URL , I have already made search on google,yahoo and etc

    Additionally , I would like to learn what I have to need for this project .. Now , I already have winwap wap emulator and Websphere Studio.. Do I need special wap server or something else to test my applications..
    Please , hurry up .. I really need your helps..
    Ergin

  • Problems with saving and inserting pages

    I am using Adobe Acrobat X Standard.   After I write a report and PDF it, I always have to insert other information in the report.  This additional information is also been PDF.  Why is it that sometimes it will not let me save the file after I have inserted new pages?  It says the file is “read-only” but I saved the file a few minutes before.  I have to save my changes to a new file name.
    Other times, I am replacing pages, and it will not let me.  I might be able to insert the new page but it will not let me delete the old page.  It says the file is open by someone else.  I am on a single laptop that is not on a LAN.   When this happens I must save what I have and close the file.  When I reopen the file I can delete the old page.
    Is there something that should be checked or unchecked?

    What is the JSP scriptlet code at line 6 ?
    By looking at the code we can identify if there are any syntax errors, otherwise we can't really guess what might be the problem.

  • Problems with facebook and loading page in Safari

    When I am chatting on facebook and try to click around on the page, most specifically when I have other tabs running on Safari, facebook will not completely load and i will get the spinning cursor on the facebook tab that will not go away. It continually tries to load with no success. I have to close the window and open a new one for it to go away. It only seems to happen when I am chatting with people on facebook chat...any suggestions?

    Ok...
    Time to get out your install disc, run the Disk Utility app and check the startup disk for errors.
    Insert your install disk and Restart, holding down the "C" key until grey Apple appears.
    Go to Installer menu and launch Disk Utility.
    (In Mac OS X 10.4 or later, you must select your language first from the installer menu)
    Select your HDD (manufacturer ID) in the left panel.
    Select First Aid in the Main panel.
    (Check S.M.A.R.T Status of HDD at the bottom of right panel. It should say: Verified)
    Click Repair Disk on the bottom right.
    If DU reports disk does not need repairs quit DU and restart.
    If DU reports errors Repair again and again until DU reports disk is repaired.
    When you are finished with DU, from the Menu Bar, select Utilities/Startup Manager.
    Select your startup disk and click Restart
    While you have the Disk Utility window open, look at the bottom of the window. Where you see Capacity and Available. *Make sure there is always 15% free space.*

  • Problem with Frameset and page session

    All,
    I am having a problem with Framesets and page session attributes. I
    have a client who's application uses a three frame frameset. They
    have a requirement on several pages that when a button is pushed two
    different pages load into the right and left frames. The way they
    are accomplishing this is that on the pages were this is required,
    they are adding target="_top" to the form declaration in their JSP.
    Then they store the page names they want to display in session,
    forward the request to the frameset, the frameset then determines
    which pages to display based on the session variables. This works
    exactly how they want it to.
    Here is our problem. We need to store some information in page
    session attributes. We have tried to get a handle to the desired
    view bean and call the setPageSessionAttribute method. However,
    since we are forwarding to the frame and the frame handles displaying
    the desired JSP, that view bean we had the handle to is not the one
    that is created to hand the display of the JSP.
    The next thing I tried was to use the request object. In the
    handleBtnRequest method, I set an attribute in the request object. I
    then query the request object in the beginDisplay event of the view
    bean. When the frame is reset the request object does not contain
    the attribute that I have set. I'm confused by this because I
    thought the request object would be available to me throughout the
    life of the request.
    Given the above information, does anyone have any suggestions? Also,
    am I going about this in the wrong manner.
    The client had been storing this information in user session, which
    seemed to work. However, since the data being stored dealt
    specifically with data for the requested page, we felt that storing
    it as page session was more appropriate.
    Thanks,

    The script on your page web page has some obvious bugs.. Best
    fix those
    first before looking to blame Flash.
    Jeckyl

  • Haven't been able to use pages for a while.  Keep getting following message.  Have tried reinstalling iWork, but no luck.  Same problems with Keynote and Numbers/Users/scottmcdonald/Desktop/Screen Shot 2012-03-14 at 9.39.52 PM.png

    Haven't been able to use pages for a while.  Keep getting following message.  Have tried reinstalling iWork, but no luck.  Same problems with Keynote and Numbers/

    Have you moved Pages from its installed location? Or just dragged a copy to your current system?
    It can't find some of its resources apparently.
    Peter

  • Problem with exporting and printing from pages to PDF

    I have a problem with my Pages
    My font will not be embeded in my pdf files.
    I have saved as a ps file and in to the destiller and my fonts are missing.
    I need to send my file to the print shop but they will not accept my file and i now understand why.
    fonts are missing...
    Is there a workaround.
    I have no problem in Indesign or quark but pages.....
    I need help
    thanks a zillion

    The font is coming from a notation software Sibelius 4 and is namned opus
    Hmmm ... Sibelius is a music notation software and notations are marked up in MusicXML. Presumably the font file is an SFNT with TrueType splines, but it is probably not installed in OS X system folders - rather in an internal Sibelius application font folder. So presumably you do not see the font in FontBook and OS X font auditing does not apply to the font.
    Sibelius exports EPS files, right? If memory serves, an EPS is still legal even if the font resource is not embedded. And in any case, we know from the behaviour that the font resource is not embedded for some reason. So how do you get Sibelius to put the font resource inside the graphic ... normally there is a button in the EPS export procedure that gives you the option to Embed All Fonts.
    You do not seem to get this button, though. Or why else would you not have checked it already and the problem would have gone away already.
    The next point in troubleshooting this is that you are not following the path that would let OS X detect that an external font resource is not embedded.
    I go from pages-print-printer- acrobat Pro 8-save as Pdf-x
    What you are doing here is telling Pages to tell OS X to generate a PostScript program within which is nested your Encapsulated PostScript program with the call to an unresolved external font resource.
    So why does Acrobat Pro not detect the unresolved external font resource? Hmm ... did you try the Preflight option in Acrobat 8 Pro? It should provide information on unresolved embeddings.
    I have also tried pages-print-printer- acrobat Pro 8 and save pdf as postscript and put the postscript file in destiller 8 pro with defalt setting high quality print
    The whole problem with EPS and PS is that this sort of situation is possible in the first place (plus, what is worse, the PS program can include custom additions to the graphics model that then fail in the PS interpreter whence Apple GX normalizing, Adobe Distiller normalizing, and Apple Quartz normalizing). You want to get as far away from EPS and PS as possible, believe me.
    So, you have not done what I posted that you should do in the first place. If I were you, I would first get rid of the problem that the EPS is making a call to an external font and then get rid of the problem that the PostScript is preserving the external call.
    To get rid of the problem that the EPS is preserving an external call, simply open the EPS in Apple Preview which includes a NORMALIZER for EPS/PS, and then save out the graphic as PDF. Alternatively, if you don't trust Quartz for some reason, set up a hotfolder for Distiller, make sure the option to embed all fonts is enabled, and convert the EPS to PDF.
    Now replace your EPS in Pages with PDF in Pages, and don't save PostScript to disk but save PDF to disk through the proper procedure which is File > Print > PDF > Save as PDF/X [for your custom configuration of the PDF/X-3 filter considering that no sane person in North Europe prints lowend US SWOP, we use ISO].
    If you begin by telling OS X that you want PDF within which fonts are supposed to be embedded ALWAYS, then you have started the right way. Otherwise, you have not told the operating system what you want to do, and this then leads you into places where you are unlikely to have the expertise to troubleshoot problems.
    So, forget placing EPS in the first place, place PDF. And forget saving PostScript to disk, save PDF to disk. If that does not sort your problem, here is the dirty solution for professional prepress.
    Adobe Photoshop has an EPS rasterizer that has wide tolerances for poor PostScript programming (so does Adobe Illustrator 6 and higher by the way).
    Therefore, if an EPS is posing problems, one workaround is to rasterize the EPS at high resolution in Photoshop and place that high resolution PDF in your layout.
    Take care that you rasterize as 1 bit at the required resolution of the print provider, probably 2450 dpi. When you save the 1 bit as PDF, Photoshop automatically compresses to a very, very small file (don't be surprised if 15Mb compresses to something like 0.5Mb).
    Rasterizing in Photoshop should not be necessary if you simply start by telling the operating system what it is you are trying to do. Then the operating system should be able to take the right decisions for you, and tell if you if finds problems it cannot resolve without turning to you.
    Good luck,
    Henrik
    would-be technical writer

  • Really having problems with organising documents in pages. For example, deleting pages deletes the whole section and I cannot insert a section break as its greyed out & sending an object to background deletes several pages - what the **** is going on???

    Really having problems with organising documents in pages. For example, deleting pages deletes the whole section and I cannot insert a section break as its greyed out & sending an object to background deletes several pages and trying to insert a text box autmatically creates new pages- what the **** is going on??? Is this programme really this badly thought out? I thought everything apple was supposed to be intuitive!?!?!? Help.

    You can not insert a section break into a textbox.
    You appear to have a lot of objects with wrap set, that once you take them out of the flow of text (by sending them to the background) causes the text to reflow and contract into fewer pages. Pages is almost unique in the way it forms up pages in Word Processing mode only so long as there is text on them.
    I suspect you probably have hammered away at returns, spaces and tabs as well to position things, which only works to add to the mess.
    Download the Pages09_UserGuide.pdf available under the Help menu and swot up a bit on how it works.
    You may find this a usueful resource as well:
    http://www.freeforum101.com/iworktipsntrick/
    Peter
    PS There is quite a lot of programming in OSX that is far from "intuitive". Pages is easy at one level, when using the templates, otherwise it can be quite frustrating.

  • Whatsnew page for 3.6.17 has formatting problems with Firefox and I.E.

    I just updated from 3.6.16 to 3.6.17n and the whatsnew page, displayed after Firefox restarted, has formatting problems in the lower right hand corner.
    I checked it with I.E. 8 and it also shows the formatting problem.
    Why wasn't this caught before the page was put into "production"?
    The URL is http://www.mozilla.com/en-US/firefox/3.6.17/whatsnew/
    There is a line with the text "Release Notes » Firefox Features » Firefox Help »" that is being displayed on top of other material.
    I wonder what a new Firefox user or an inexperienced user would think of this? They might think that they did something wrong or, worse, they might consider Firefox had problems and they won't use it.
    This reflects badly on Firefox.
    One more thing, could someone make this textarea taller and wider. It is so small as to cause problems typing and proofing the material.
    The URL is https://support.mozilla.com/en-US/questions/new?product=desktop&category=d6&search=whatsnew+page+for+3.6.17+has+formatting+problems+with+Firefox+and+I.E.&showform=1
    How about upping the cols and rows values? They are currently rows="10" cols="40"

    As you have a Power Mac you also have a alternative option to consider which is a third-party build from http://tenfourfox.blogspot.com/2011/08/601-now-available.html

  • Problem with vista and 5.1

    problem with vista and 5. i install my old audigy 2 zs exp pro with DTT2500 speaker
    In my new pc.
    i install vista 64 and SBAX_PCDRV_LB_2_8_000 driver from creative site.
    when i go to control panel/sound and test the 5. surrund ' iget only the two front speaker.
    why is that?
    i try to play a song from vista folder "Distance" and i get all 5 +sub to play.
    do i miss something?
    is the test worg and with another test i can get all spedajer to work or the driver is not good?
    thanks for all you help
    last update...
    i can get 4 speaker when i use the fourpoint mode on the desktop theather 5. dtt2500 digital,
    but in movie mode i get only 2 front speaker.
    i use the digital out from the sound blaster.
    Message Edited by raflevi on 05-4-2009 02:38 [email protected]

    My apologies about not explaining further about disabling SPDIF passthrough. See the steps below to enable DDL encoding.
    ***Before proceeding please make sure that you've purchased, installed and activated the DDL pack***
    . Open Creative Audio Console, go to the Decoder tab to disable driver level encoding and enable SPDIF passthrough (this is done by selecting SPDIF passthrough or any similar option that enable the use of an external decoder) instead of using the built-in decoders.
    2. Open up your playback devices window (right click on the speaker icon on the taskbar and select playback devices) and set analog speakers (not SPDIF) as your default device. This is VERY IMPORTANT step, or else you get the "the device is busy" error when enbaling DDL encoding.
    3. In the Audio Console, select the Encoder tab and enable DLL encoding.
    Note:
    When DDL encoding is enabled, it makes exclusi've use of your SPDIF connection so, no passthrough is possible. The default output format when using DDL encoding is 48KHz/6 bits. If you make use of any AC3 audio filters (such as ac3filter/others included in codec packs/media player softwares) when DLL encoding is enabled, then please change their output device to analog speakers instead of SPDIF.
    To use back SPDIF passthrough (when playing back media with a pre-encoded audio source), open up Audio Console and disable DDL encoding and in the Playback Devices window change the default device to SPDIF. If you make use of any AC3 audio filters (such as ac3filter/others included in codec packs/media player softwares) then please change their output device back to SPDIF. You may also wish to change back your output format to 92KHz/24 bits (right click on SPDIF and select properties -> Advanced tab).
    raflevi wrote:
    when you said to install ddl? pack you mean the "[url="http://buy.soundblaster.com/_creativelabsstore/cgi-bin/pd.cgi?page=product_detail&category=Software&pid=F 2222SR6PAKH5DGY6SD">Dolby Digital Li've Pack - SB Audigy Series[/url] "?
    thanks again for all your help.
    i wanted to use the 5. function mostly for games
    Yes... also please see the link in my previous post.
    Hope this answers your questions.

  • Message bundles accessed from JSF and JSP pages

    Hello, everybody!
    I'm developing a localized JSF application. It is working pretty well until now.
    These are my message files:
    mensagens.properties
    mensagens_en_US.propertiesThis is how they're configured in faces-config.xml:
    <application>
        <resource-bundle>
            <base-name>br.urca.www.biblioteca.web.mensagens</base-name>
            <var>msg</var>
        </resource-bundle>
    </application>And this is how I access the messages in a page:
    <h:outputText value="#{msg.titulo}" />Nothing new until now. But now there was a need for me to have a raw jsp page in
    my web application. This page is displaying ok but I also need to access the
    message bundles as I'm able to access in the normal jsp with the JSF components.
    As you should know I can't use something like the above code with an +<h:outputText>+
    to access the messages because this is a JSF component and I'll not be able to use
    JSF components with this raw jsp page.
    So, my question is: how do I access my localized messages from a raw jsp page? I
    suppose there should be a way to do this, but unfortunately I started programming
    to the web world in Java with JSF, not JSP, so I don't know how to do this with
    JSP.
    Thank you very much.
    Marcos

    BalusC wrote:
    Just include [jstl-1.2.jar|https://maven-repository.dev.java.net/repository/jstl/jars/] in your classpath and define the fmt taglib in your JSP. Nothing more is needed.
    Hello, BalusC. Thank you for your help. We're almost there. After I have included the jstl-1.2.jar you provided me I can use the fmt tag and access message bundles from my raw jsp page (even though I had to provide other message bundles instead of the ones that I use in the other jsf pages, but it's better than nothing).
    Now there just on problem to be fixed. The jsp page is not aware when I change the locale of my application. I change this locale in a jsf page.
    I have this component:
    <h:selectOneMenu value="#{pesquisaAcervo.idiomaAplicacao}"
        valueChangeListener="# {pesquisaAcervo.idiomaAplicacaoMudado}" onchange="submit();">
        <f:selectItems value="#{pesquisaAcervo.idiomasAplicacao}" />
    </h:selectOneMenu>that calls this event in my backing bean class:
    public void idiomaAplicacaoMudado(ValueChangeEvent e)
        fIdiomaAplicacao.liberarItens();
        Idioma idioma = Idioma.deString(e.getNewValue().toString());
        // This line is for JSF
        FacesContext.getCurrentInstance().getViewRoot().setLocale(idioma.localidade());
        // This line is for Tiles
        FacesContext.getCurrentInstance().getExternalContext().getSessionMap().
            put(org.apache.tiles.locale.impl.DefaultLocaleResolver.LOCALE_KEY, idioma.localidade());
    }So, do I have to include another line in the idiomaAplicacaoMudado event above in order for the jsp page load the correct resource bundle? Or what else do I have to do?
    Thank you.
    Marcos

  • Problems with JSF and included subviews

    Hi everybody,
    I' ve got a problem with JSF and included subviews which makes me going
    crazy. I've got no clue why my web-pages are represent wrongly. The only
    tip I've got is that it must be connected with the kind I do include my JSF-pages.
    When I use <%@file="sub.jsp"%> my pages are are represent right. When I use <jsp:include page="Sub.jsp" /> or <c:import url="Sub.jsp" /> ( mark: the usage of flush="true" or flush="false" doesn't matter )
    my pages are represent wrongly.
    The usage of tags like f:facet or f:verbatim were also included but didn't point to an solution.
    I searched the whole Sun Developer Forum and some other web-sites for any solution for my problem but the given hints and clues didn't help. Now I'm trying to post my problem directly in Sun's Forum in hope to get help.
    My environment is the following:
    JAVA JDK 1.5 Update 4
    Tomcat 5.5.9
    JSLT 1.1
    Sun JSF 1.1
    Win 2K
    Here's my code:
    Main.jsp
    <%@ page language="java"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%
              String path = request.getContextPath();
              String basePath = request.getScheme() + "://" + request.getServerName()
                        + ":" + request.getServerPort() + path + "/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
         <base href="<%=basePath%>">
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">   
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
         <link rel="stylesheet" href="stil.jsp" type="text/css" />
    </head>
    <body>
         <f:view>
              <h:form>
                   <div class="table">
                        <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 1"/>
                             <h:outputText styleClass="tdinfo" value="value 2"/>
                        </div>
                        <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 3"/>
                             <h:outputText styleClass="tdinfo" value="value 4"/>
                        </div>
                   </div>
              </h:form>     
              <jsp:include page="Sub.jsp" />
         </f:view>
    </body>
    </html>Sub.jsp
    <%@ page language="java"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <f:subview id="subview">
         <h:form>
              <div class="table">
                   <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 11"/>
                             <h:outputText styleClass="tdinfo" value="value 22"/>
                   </div>
                   <div class="tr">
                        <h:outputText styleClass="tdleft" value="value 33"/>
                        <h:outputText styleClass="tdinfo" value="value 44"/>
                   </div>
              </div>
         </h:form>
    </f:subview>stil.jsp
    <%@page contentType="text/css"%>
    <%
        String  schwarz     = "#000000",
                grau1       = "#707070",
                grau2       = "#c0c0c0",
                grau3       = "#e0e0e0",
                grau4       = "#e8e8e8",
                grau5       = "#fdfdfd",
                blau        = "#0000dd",
                tuerkis     = "#00cfff";
        String  liniendicke = "1px",
                linienart   = "solid";
        String allgemeineTextFarbe           = schwarz;
        String allgemeineHintergrundFarbe    = grau3;
        String infoTextFarbe                 = blau;
        String fieldsetRandFarbe             = blau;
        String fieldsetRandDicke             = liniendicke;
        String fieldsetRandArt               = linienart;
        String hrLinienFarbe                 = blau;
        String hrLinienDicke                 = liniendicke;
        String hrLinienArt                   = linienart;
        String inputAktivHintergrundFarbe    = grau5;
        String inputReadonlyHintergrundFarbe = grau4;
        String inputPassivHintergrundFarbe   = grau4;
        String inputPassivFarbe              = schwarz;
        String inputRandFarbe1               = grau1;
        String inputRandFarbe2               = grau5;
        String inputRandDicke                = liniendicke;
        String inputRandArt                  = linienart;
        String inputButtonHintergrundFarbe   = grau3;
        String legendenFarbe                 = blau;
        String linkFarbe                     = blau;
        String linkAktivFarbe                = tuerkis;
        String linkBesuchtFarbe              = blau;
        String linkFocusFarbe                = tuerkis;
        String objectGitterFarbe             = grau5;
        String objectGitterDicke             = liniendicke;
        String objectGitterArt               = linienart;
        String tabellenGitterFarbe           = grau5;
        String tabellenGitterDicke           = liniendicke;
        String tabellenGitterArt             = linienart;
    %>
    <%-- ----------------------------------------------- --%>
    <%-- Textdarstellung mittels der Display-Eigenschaft --%>
    <%-- in den Tags div und span                        --%>
    <%-- ----------------------------------------------- --%>
    *.table {
        display:table;
        border-collapse:collapse;
    *.tbody {
        display:table-row-group;
    *.tr {
        display:table-row;
    *.td,*.tdright,*.tdleft,*.tdinfo,*.th {
        display:table-cell;
        padding:3px;
        vertical-align:middle;
    *.td,*.th {
        text-align:center;
    *.tdright {
        text-align:right;
    *.tdleft {
        text-align:left;
    *.tdinfo {
        color:<%=infoTextFarbe%>;
        text-align:right;
    *.th {
        color:<%=infoTextFarbe%>;
        font-weight:bold;
    }thanks in advance
    benjamin

    Hello Zhong Li,
    many thanks for your post, but it didn't work.
    My problem is that the JSF-Components im my included or imported
    JSP-Pages does not accept any kind of style or styleClass for
    designing. The components take over the informations for colors
    but not for alignment.
    When I take a look at the generated JAVA-Source in $TOMCAT/WORK/WEBAPP for my sub.jsp ( sub.java )
    it seems that the resulting HTML-page would be presented correctly.
    But later when I start the application via Firefox or Mozilla the html-sourcecode is totally wrong.
    In my example I create a simple grid with 2 rows and 2 columns.
    Both columns contains JSF-Outtext-Components and are included with div-tags.
    The generated Sub.java shows that the text would be setted in the div-tags. Unfortunately the html-sourcecode represented by my browser shows that jsf-text is not setted in the tags but in the <h:form> tags. The div-tags are neither rounded by <h:form> nor containing the JSF-OutText-Components.
    Any clue?
    Many thanks Benjamin
    Here is the html-code from Firefox:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
         <base href="http://polaris21:8080/webtest/">
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">   
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
         <link rel="stylesheet" href="stil.jsp" type="text/css" />
    </head>
    <body>
         <form id="_id0" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
              <div class="table">
                   <div class="tr">
                        <span class="tdleft">value 1</span>
                        <span class="tdinfo">value 2</span>
                   </div>
                   <div class="tr">
                        <span class="tdleft">value 3</span>
                        <span class="tdinfo">value 4</span>
                   </div>
              </div>
              <input type="hidden" name="_id0" value="_id0" />
         </form>     
          <form id="SUB:_id5" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
               <span class="tdleft">value 11</span>
              <span class="tdinfo">value 22</span>
              <span class="tdleft">value 33</span>
              <span class="tdinfo">value 44</span>
              <input type="hidden" name="SUB:_id5" value="SUB:_id5" />
         </form>
         <div class="table">
              <div class="tr">
              </div>
              <div class="tr">
              </div>
         </div>
    </body>
    </html>

  • Problems with Safari and Firefox (HTTP?)

    Problems with Safari and Firefox (HTTP?)
    On a laptop G4, 10.5.8 and Safari 5.02 I experience the following:
    On the account of my oldest daughter everything works fine, i.e. wireless internet works and no problems with mail or safari.
    On the same laptop, on the account of my other daughter, the wireless is OK, she can mail etc. But safari nor firefox works. It says: can’t find server (whatever site) and in the activity window it looks if safari tries to open files (in the safari preferences-folder) in stead of http. Same applies to Firefox, so maybe it has more to do with HTTP in general?
    What goes wrong? What to do? I tried the following on the host terminal (tips from Apple)
    defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false
    and
    defaults delete com.apple.safari WebKitDNSPrefetchingEnabled
    but that did not help,
    Nanne

    I'm still wondering why it happens now at this moment in time...
    PC does seem to be a bit odd & inconsistent, the few times I've tested with it, at least so far as we content filtering goes; and if I remember rightly, you're not the first to report previously ok settings suddenly preventing some or all internet until pc is switched off altogether.
    It may work when re-enabled

Maybe you are looking for

  • ITunes will not play/allow import of any audio files

    I have iTunes installed via Windows 7. Yesterday, iTunes stopped playing any audio files. I first noticed this problem after streaming music to my apple TV went bonkers. I tunes would play the first 3 seconds of a song and go onto the next one, even

  • How to include md5 package in application

    Hi All, First of all sorry I posted in another users thread. In the thread http://forums.sun.com/thread.jspa?threadID=5426671 the person used org.bouncycastle.crypto.digests.MD5Digest for doing md5. I need some help here on how you include the org.bo

  • Is there a way to identify the survey respondent?

    Can you identify who completed the survey by name or by email address?

  • Workflow Task Agent Assignment for PO Rel

    Hello; Can someone tell me how the system can be set to forward a work item for the person responsible for PO release, meaning based on the department who own the goods the system should find the person who's the approver of that department. Thanks I

  • Developer 6i....plz hlp

    I am having problem while connecting to database from forms6i. I have installed Oracle 8i personal database(downloaded version from oracle site). This part was installed correctly and I could connect to database and run scripts. Later I tried to inst