FacesServlet routing to a different jsp url

I would like to encode information on which businessobject is currently in use in the URL. To view my Businessobject with with ID=123456 an URL would look like: http://host/faces/123456/view.jsp Still it should call the /view.jsp as should http://host/faces/3434/view.jsp and so on. The part between the /faces/ and the /view.jsp is only for my application use.
Any hints on how to achive this?
In the web.xml the facesservlet has a mapping of faces/* which makes it work for those urls, too. But how do I make it forward to /view.jsp. I the moment I believe it is looking for /123456/view.jsp which obviously does not exist.

Andy,
I do have an afh:body on my page. I just tried to replace it with a <body> tag, but then the partial page rendering won't work anymore (this caused all tabs of the detail page not to work anymore). I read that either afh:body, af:document or af:panelPartialRoot is needed.
So I used af:panelPartialRoot instead, but that wouldn't help either.
Anyway, I still can't navigate to a different page in the disclosure listener of my detail page tabs.
Is there maybe a way to treat a tab as a normal button, with an action event and an according listener?
Torsten

Similar Messages

  • How to go to different jsp pages based on different selection?

    I put SELECT and OPTION in the page. I want to go to different jsp
              pages when different OPTION been selected, but there is only one URL
              in the action attribute. How can I do it ?
              

    add a javascript on the select tagg:
              onchange=javascript:jump(this);
              Then make a javascript to pull out the url from the value attribute in the
              selected option tagg.
              http://javascript.internet.com/
              "hgui" <[email protected]> wrote in message
              news:[email protected]..
              > I put SELECT and OPTION in the page. I want to go to different jsp
              > pages when different OPTION been selected, but there is only one URL
              > in the action attribute. How can I do it ?
              

  • 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

  • How can I use the same object in the different jsp files?

    I am doing a project. I have finished my jave source files and compiled them successfully. And I also wrote a main method to test my classes, they also worked well. Now I am trying to use my jave code in the jsp files. But I meet a problem, in my method of java source file, I can generate a object of a class, and use it in the whole main method. But in the different jsp files, how can I do same thing?
    For example, in the .java file,
    Vector vl = new Vector();
    While ...{
    vl.add(...)
    In each of my .jsp file I want to do one loop of the above, meanwhile I want to do that in the same object.
    I hope you can understand what I mean. Really need your help!

    put your object into a session and you can the use it in all the jsps as long as the session is valid. Or you could create a static variable in the class that only creates one instance off an object and then create a static method to return this object.

  • How can I share values between different jsp pages?

    Hi,
    I'm doing a jsp, bc4j application (JDeveloper 9.0.3), and I need to share some values between different jsp pages. To do this,
    I have used the tag <jsp:usebean.....></jsp:usebean> in this way:
    on pageone.jsp
    <jsp:useBean id="param" scope="session" class="MyPackage.Parameters" ></jsp:useBean>
    on pagetwo.jsp     
    <jsp:useBean id="param" scope="session" class="MyPackage.Parameters" ></jsp:useBean>
    and so on, in order to refer to the same instance of the class "Parameters".
    After deploying, the application works well only if the client is the same pc where the AS resides, otherwise the variables of "Parameters" are null.
    Please, could you help me?
    Thanks
    Nunzio.

    I am seeing an indication on 9.0.3 that static includes are not static, but instead always dynamic. The compiler generates a call to the included page, and doesn't include the content in the calling page as it should.

  • How to split a single file and then route it to different systems

    Hi All,
    I have a requirement like...my incoming file(single file) needs to be split into 3 files based on a field "company code".and then route it into different systems.
    my incoming file is like this .....
    Header,name,.....,.....,........,.....,.....
    Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......
    EOF.
    I need to split this file and my ouput file should be like this
    For 1st system
    Header,name,.....,.....,........,.....,.....
    Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......
    EOF.
    For 2nd system
    Header,name,.....,.....,........,.....,.....
    Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......
    EOF.
    For 3rd system
    Header,name,.....,.....,........,.....,.....
    Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......
    EOF.
    and then send it three systems based on company code.
    Can anyone tell me how this can be achieved?
    Thanks,
    Hemanth.

    Hi Nallam,
    I tried the same thing but in the input file as there are different company codes,It is not splitting the file into three parts and sending only concerned data to repective system instead the whole file is going to the all the systems.
    I came to know that the file has to splitted in the mapping only, we are able to do it by using mapping but the problem is in Routing,as in receiver determination we makes use of source structure for giving the condition. Can you please help me on this.
    Thanks,
    Hemanth.

  • Can we have two different web url for a same instance ??

    Can we have two different web url for a same instance ??
    I have read it somewhere that it's possible in R12....please correct me if I am wrong...and if it's correct please let me know the doc id for it...

    Hi again;
    Pelase also see Hussein Sawwan previous great post
    Multiple URL (hostname.domain) to the same instance
    Multiple URL  (hostname.domain) to the same instance
    Regard
    Helios

  • The best  way of carrying the search string across different jsp pages?

    I heard about transfer object. What about carrying object with session for different pages.
    Please suggest me the best approach to
    carry the search string across different jsp pages?
    thanks
    vijendra

    I doubt its possible even with a fancy HTML widget, although the last iBA update now allows links to other books.

  • Can I have two different podcast  URLs on one iWeb website?

    Can I have two different podcast  URLs on one iWeb website?

    I don't think anybody understands your question. Can you elaborate?

  • Setting different action urls to different buttons

    Hello everyone
    I have 2 buttons on my jsp page, 'submit' and 'reset'. I need to link each button to different urls when user clicks on it. For example, when user clicks on submit button, it should go to confirmation.jsp and when the user clicks on reset button, it should go to registration.jsp. I dont want to use javascript or any other programming language but rely only on jsp and html. Is there a way to do it? Thanks. I need to solve this for an assignment. Much appreciated.
    Bawa

    hope you use struts, put these action mapping in the struts-config file.
    Call submitaction.do in 'submit' button click.
    and call resetAction in 'reset' button click. You action class will forward the page.
           <action path="/submitAction"
                type="com.admin.manage.action.SubmitAction"
                name="manageForm"
                scope="request">
         <forward name="success" path="/jsp/confirmation.jsp" />     
           </action>                                       
           <action path="/resetAction"
                type="com.admin.manage.action.ResetAction"
                name="manageForm"
                scope="request">
         <forward name="error" path="/jsp/registration.jsp" />          
           </action>  If you don't use struts, call corressponding jsp's in each button click directly.

  • SAME EJB 3.0 Stateful Session bean for different JSP sessions returned

    Forum,
    I have a strange problem utilizing stateful session beans. Please note, that I am using jdeveloper for the following:
    1) Here is a basic stateful session bean:
    @Stateful(name = "DemoClass")
    public class DemoClassBean implements DemoClass,
               DemoClassLocal, SessionSynchronization {
          public static int id=0;
          public DemoClassBean() {
          id++;
          public int getId() {
             return id;
          //... other methods
    }2) This bean is accessed from a JSP for testing purpose, I am copying only the script used in JSP:
    <%
       DemoClass bean = null;
       try {
          bean = (DemoClass) ((new javax.naming.InitialContext()).
                       lookup("DemoClass "));
          System.out.println("ID=" + bean.getId() );
          } catch (javax.naming.NamingException e) {
             // TODO
    %>If this page is addressed by different clients, from different browsers, the same bean is returned.
    Here is what I see in the logs:
    ID=1
    ID=1
    ID=1
    The same problem is being observed when this session bean is accessed from a JSF Backing bean.
    What could be wrong? Is this a bug in oc4j / jdeveloper (version 10.1.3.3.0)?
    Edited by: smw000000001 on Nov 17, 2008 10:52 AM

    Hi,
    The code for stateful is perfectly fine and working in a normal way. The way you are trying to implement the stateful session bean in your application is wrong.
    think of binding the stateful session bean with HttpSession object.
    So that you will get a unique stateful session bean object.

  • Why is wireless router connectivity is different with Powerbook than iMac?

    I had problems with my 10.2 on the G3 450 iMac (that caused me to go to 10.3 about 2 weeks ago), my trusty old Buffalo router fried its WAN port. I replaced it with a Netgear unit, then a Linksys unit, now I'm back to Buffalo. The ongoing problem is that the laptop has a heck of a time connecting to the internet - while the iMac (via ethernet) has no problems whatsoever. It doess/did this with every manufacturer of routers I tried (since first I thought it may be a Netgear incompatibility issue).
    Strange part about the problems: Only initially does it spend 20+ seconds (close to Safari/Firefox timeout) "looking for" the host. Once it has found it, if you click on any links within the same host, it's lightning-fast. Just the initial callup seems to be inordinately difficult. I was hoping new firmware for the wireless modem, 10.4, the latest Airport update etc would alleviate the situation - no such luck. It USED to work fine on the old wireless router ... Also, it does this "looking for" business whether I have security enabled or not (I usually run 128bit encoding).
    I don't really mind waiting for a few seconds for a site to load, but when you're talking about something like Yahoo or ESPN, all these independent advertising servers have to be contacted to load the page and - you guessed it - it's a 20+ second delay for each one...
    I've rebooted the router and the laptop many times; I doubt it's the cable modem as the Ethernet on the iMac comes from the same router an doesn't have a problem at all. Any chance it's a setting of some sort in the preferneces panels?
    The problem appeared initially with the Netgear router. The whole reason I went back to Buffalo is that I never had any issues in the 4 years I owned the previous one (until the WAN port went out). I also tried a Linksys router but admittedly didn't spend a lot of time with it as the delay problem appeared right from the start.
    As far as 3rd party hardware is concerned, I wouldn't mind just getting an Apple Airport station at this time, but really don't want to spend the $ if it's an issue with either the laptop or its Airport card. I guess I could get one here at the local Apple store and bring it back if it doesn't work any differently (at least then I'd know it's either a laptop or a Comcast Cable-issue...).
    System setup:
    Desktop: G3 "Graphite" iMac / slot-loading / 400Mhz / 640MB RAM / 10.3.9
    Laptop: 15" G4 Aluninium Powerbook / 1.25Ghz / 1GB RAM / 10.4.6
    Wireless: Buffalo AirStation Turbo G WHR-HP-G54 (wireless to laptop / ethernet to iMac).
    Powerbook 15/1.25GHz/1GBRAM   Mac OS X (10.4.6)  

    It sounds as though you're having a problem with DNS lookups. Try this, type into Terminal (Applications > Utilities)…
    sudo lookupd -flushcache
    It will subsequently ask you for your administrator password. Type it in and then wait for the prompt to return. Do not do anything before then. Now, restart and see if things are any better.

  • % in JSP url

    I need to have JSP accept un encoded URL with chars like %. Is there anyway I can do it ?
    See the difference between http://www.google.com/search?q=%+in+url (it works) and http://onesearch.sun.com/search/developers/index.jsp?qt=%+in+url (doesn't work)
    Anthos

    Also this HTTP request got uncoded characters which fails request params in cases of %, # and so on.
    1. Save the following as params.jsp
    <%@ page contentType="text/html;charset=UTF-8"%>
    <HTML>
    <HEAD>
    <TITLE></TITLE>
    </HEAD>
    <BODY>
    <TABLE BORDER='1'>
    <TR><TD>NAME</TD><TD>VALUE</TD></TR>
    <%
    java.util.Enumeration names = request.getParameterNames();
    while(names.hasMoreElements())
    String name = (String) names.nextElement();
    Object value = request.getParameter(name);
    out.println("<TR><TD>" + name + "</TD><TD>" + value + "</TD></TR>");
    %>
    </TABLE>
    </BODY>
    </HTML>
    2. Invoke as http://localhost.../params.jsp?param1=value1&param2=value2
    and http://localhost.../params.jsp?param1=value%1&param2=value2 and see the difference.

  • XML mapped to IDoc routed to two different receivers

    Hello gurus,
    I have an XML document coming into XI which needs to be mapped into an IDOC, then sent to two different systems (not to both of them) based on a value in the XML (the value is actually the SAP partner ID).
    Can this be done in BPM? Perhaps using Enhanced Receivers would be a viable solution for this?
    Thank you!

    have u looked into XPaths ?
    Ref:
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    /people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers
    Here based on a field in your message you can route the message to a receiver.
    Also ref: /people/venkataramanan.parameswaran/blog/2006/03/17/illustration-of-enhanced-receiver-determination--sp16 for enhanced recv. det.

  • JSP URL encoding

    Hi I've got this link that leads me to print_article.jsp. When I use the link, the encoding fine in the page that I get to. So in print_article.jsp, when I call ${param.title} it displays 'Assurance m�dicale � la carte', as it should.
    If I cut and paste that URL in a new browser, the encoding for ${param.title} is wrong. ${param.title} gives Assurance m&#65533;dicale &#65533; la carte.
    here is the URL in question:
    http://localhost/print_article.jsp?page=/assurance-voyage/trouver-produit/liste-protections/plan-medicaux/assurance-medicale-carte.fr.html&title=Assurance%20m�dicale%20�%20la%20carte&lng=fr
    I tried forcing the encoding using utf-8, windows-1252 and ISO-something and none of those work.
    I encoded the URL ( and only the param.title part ) using java.net.URLEncoder. That didn't work either.
    I tries IE7, firefox, got the same behavior
    What has me baffled is that all works fine, except when I cut and paste the URL in a new browser, new window, the I lost the encoding on the parameter title.
    Any idea?

    Design advice that solves the problem:
    Don't send whole title as url parameter, send only some article id and get all the other article attributes using this id.

Maybe you are looking for

  • #Multiivalue Error

    Hi all, i created one Variable in my report and its valid. when i am using that variable , i am getting multivalue Error. May i know why this Error coming? My scenario is: =If([U Bpsegment]=1) Then [U Cprice] ElseIf([U Bpsegment]=2) Then [U Cprice2]

  • Button animation in selected state.

    Can I have a video or animation playing on a button only in the selected state(and still in the the other state)? atm I can have a video looping in in a normal menu but this dosen't work in a layered menu?

  • Whether NO Contract phone needs to be unlocked?

    Hi Friends, One of my friend is travelling from US to INDIA,so i have pre booked NOKIA LUMIA 1520 NO CONTRACT AT&T mobile phone on nov 21st for ~550$ via microsoftstore,now the shipment is in progress.My friend will receive it in couple of days. My q

  • Interactive PDF in CRM WEBUI

    Hi Experts, could you please tell me, if there are any issues with "Interactive PDF in CRM WEBUI". and please tell me the exact difference between the static PDF and Interactive PDF. Thankyou, raghu.

  • Unwanted time delay

        I am trying to control the motion of a stepper motor using LabView 8.0.  I have had success controlling it with the terminal that comes with the motor, however I would like to have an end-user friendly interface.  I have written a vi that works f