On 6/13/07, Sudhanshu Ojha <[EMAIL PROTECTED]> wrote:
Hey

Thnx for the suggestion, but its not solving the problem I am trying to
extend the ViewHandler class and override its abstract methods. Does any
one hav any idea how to do that.


Shale itself extends ViewHandler functionality[1], so you could use
that as an example.  However, it doesn't start from the raw
ViewHandler abstract class.  Instead, it receives a copy of the
original ViewHandler in its constructor, and delegates to that for
functionality that did not need to be changed.  You'll find this to be
substantially easier if you only need to modify one or two methods.

As to your original question, you are going to face one challenge that
comes from the fact that JSF is based on the servlet spec, and this
has an implication for URLs.  Your URLs *must* be mapped to
FacesServlet on the way back in, or the JSF processing will not take
place.  You can use prefix (/faces/*) or suffix (*.faces) style
mapping, but you'll need to use one or the other, meaning you'd end up
with either of:

* abc.com/Motorolla.faces
* abc.com/faces/Motorolla.jsp

A completely separate approach to this might be some sort of servlet
filter that intercepts the requests before the JSF servlet, and does
an internal redirect.  I haven't thought all the way through what you
would need to accomplish, but I don't think there are any showstopper
problems.

Thanx

Sudhanshu


Craig

[1] 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-view/src/main/java/org/apache/shale/view/faces/ViewViewHandler.java?revision=489926&view=markup



------------------------------------------------------------

Sudhanshu,

A very straightforward approach is to use a servlet filter that parse
the
URL and forwards to the proper JSF page. There are some other
approaches,
though -- check the archives for this mailing list (and others, such as
MyFaces ad FaceletS). This issue has been discussed a lot.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kito D. Mann - Author, JavaServer Faces in Action
http://www.virtua.com
<https://server.kproxy.com/servlet/redirect.srv/p5.p1.pbcd.pescfho.psfe/
>  - JSF/Java EE consulting, training, and mentoring
http://www.JSFCentral.com
<https://server.kproxy.com/servlet/redirect.srv/p5.p1.pbcd.pscqorbihrd.p
wji/>  - JavaServer Faces FAQ, news, and info

* Sign up for the JSF Central newsletter!
http://oi.vresp.com/?fid=ac048d0e17
<https://server.kproxy.com/servlet/redirect.srv/p5.p1.pto.pdaodb.pqdc/?f
id=ac048d0e17>  *

> -----Original Message-----
> From: Sudhanshu Ojha [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 11, 2007 6:38 AM
> To: [email protected]
> Subject: URL Masking
>
> Hey
>
> I want to make my web pages  SEO(Search Engine optimized), for that I
> want to change the URLs  like if its showing information abt Motorola
> cell phone it should show..
>
> abc.com/Motorola
<https://server.kproxy.com/servlet/redirect.srv/p5.p1.pfhj.plyx/Motorola
>  instead of  abc.com/product.faces
<https://server.kproxy.com/servlet/redirect.srv/p5.p1.pfhj.plyx/product.
faces>  the content of the
> pages are not static. So the url should change according to the
> products.
>
>
>
> I am using jsf and java.
>
>
>
> Sudhanshu Ojha
>
> V2Solutions
> A New Vision to Solutions
> India : +91-22-66733201  Ext - 667
>
> US   :  1-408-454-6051    Ext - 667
> http://www.v2solutions.com
<https://server.kproxy.com/servlet/redirect.srv/p5.p1.pbcd.pe2dayiiyffl.
pxkj/>
>





Sudhanshu Ojha

V2Solutions
A New Vision to Solutions
India : +91-22-66733201  Ext - 667

US   :  1-408-454-6051    Ext - 667
http://www.v2solutions.com




Reply via email to