You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Volker Weber <us...@weber-oldenburg.de> on 2006/01/17 15:37:46 UTC

Re: myFaces - servlet redirect.

Hi,

i didn't implement this, i just have mentioned we have this in tobago :-).

@Jeff: i don't understand yout last post on users@myfaces.

you have a mapping of "/view/" for the servlet ant the url
  http://localhost:8080/ebusiness/faces/view/task?id=1
i wonder why "/view/task" is mapped to the Servlet .

try mapping "/view" and url
  http://localhost:8080/ebusiness/faces/view?id=1

If this not works, create a small example app we can work with.

regards
  Volker

Matthias Wessendorf wrote:
> Hi Volker,
> 
> since you implemented the NonFacesRequestServlet, could you helpout?
> I have not used the mentioned Servlet, just looked at the source to
> talk about "how to redirect to a faces page" that part seems to work,
> but his commandbutton has some issues.
> 
> Thanks,
> Matthias
> 
> On 1/17/06, Jeff Porter <je...@gmail.com> wrote:
> 
>>Hi Matthias,
>>
>>Sorry to email you directly, but I'm stuck and in need of help.
>>
>>We talked on the myFaces mailing list, the subject was "How can I redirect
>>from a servlet to a JSF page".
>>
>>I've still got the problem that after I redirect from the servlet to my JSF,
>>the commandButtons on the page no longer work.
>>(I get a 404 page displayed)
>>
>>If I do not add the following to web.xml, then the commandButton's requests
>>are passed to my NonFacesRequestServlet.
>>
>>With the following added, the commandButton's requests are not passed to
>>NonFacesRequestServlet, but they also do not invoke the action in the
>>commandButton link.
>>
>>Web.xml code...
>>
>>    <servlet-mapping>
>>        <servlet-name>Faces Servlet</servlet-name>
>>        <url-pattern>/faces/*</url-pattern>
>>    </servlet-mapping>
>>
>>
>>If you have any ideas, that would be great.
>>I'm going nuts over this problem.
>>
>>Thanks for taking the time to read this.
>>
>>Jeff
>>
> 
> 
> 
> --
> Matthias Wessendorf
> Zülpicher Wall 12, 239
> 50674 Köln
> http://www.wessendorf.net
> mwessendorf-at-gmail-dot-com
> 

-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.

Re: [Solved] Another myFaces - servlet redirect issue.

Posted by joatom <jo...@joatom.de>.
I figured it out, allthough it seems to be more like a work-around rather
then a nice solution.
Anyway,

I made a new file 'servlet_redirect.jsp' only including:

<%response.sendRedirect("http://localhost:8080/faces/page/viewer/details.jsp");
%>


Besides, I changed the config to

 <navigation-rule>
        <navigation-case>
                <from-outcome>page/viewer/details</from-outcome>
                <to-view-id>/page/viewer/servlet_redirect.jsp</to-view-id>
        </navigation-case>
  </navigation-rule> 

Done! Everything works just fine even backnavigation.

cya,

Johannes
-- 
View this message in context: http://www.nabble.com/Re%3A-myFaces---servlet-redirect.-tf936557.html#a9126751
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Another myFaces - servlet redirect issue.

Posted by joatom <jo...@joatom.de>.
Hi,

I've written a NonFacesRequestServlet which works almost fine:


public class MyServlet extends NonFacesRequestServlet{
  public String invokeApplication(FacesContext fc){
    ...
    return "page/viewer/details.jsp";
  }
} 

  <servlet-mapping>
    <servlet-name>PromoDetailServlet</servlet-name>
    <url-pattern>/faces/detail.jsp/</url-pattern> 
  </servlet-mapping>

  <navigation-rule>
	<navigation-case>
		<from-outcome>page/viewer/details</from-outcome>
		<to-view-id>/page/viewer/details.jsp</to-view-id>
	</navigation-case>
  </navigation-rule>



So, after invoking the Servlet the navigation rule brings me to details.jsp
view and the browser shows the URL: "..faces/detail.jsp?entry_id=1234". 
Unfortunatily, I cannot make any  page-reloading (<tc:tab
switchType="reloadPage"..>) on the "details.jsp" page because it'll lead to
the URL: "../faces/detail.jsp/page/viewer/details.jsp".
I tried out a <redirect/> in the navigation rule to to come out at
"../faces/page/viewer/details.jsp" instead of "../faces/detail.jsp". But it
didn't work.

I would be pleased by any suggestions on that one?

btw: keep up the gorgeous work on tobago ;-)

-- 
View this message in context: http://www.nabble.com/Re%3A-myFaces---servlet-redirect.-tf936557.html#a9029978
Sent from the MyFaces - Users mailing list archive at Nabble.com.