Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

newbie question: default view?

 
Edgar Castanedo
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I am new to JSF. I am currently reading the JSF documentation on the Sun website. I have tried to create a default page for all navigation cases, so I did something like this:



For some reason though, no matter what URL I try and reach, I get a 404 error like the following:

If I try and access test.do it gives me a test.jsp (404) not found error.

Does that make sense? Does JSF try and load a file with the same name as call I made, but replaces '.do' with '.jsp'?

If so, how would I achieve the behavior I want with JSF? I have looked (almost) everywhere and it seems like what I have above is the way to do it in JSF, but it doesn't seem to work for me.

I am coming from Spring and Struts so I am not completely new to MVC frameworks. I also have some knowledge on JSF now, since I have been reading about it, but nothing I have seen so far has given me any indication that I could do what I want, other than the snippet that I provided above.

Thanks in Advance!
 
Edgar Castanedo
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, so upon further investigation it does seem that there is a whole default suffix thing that will replace '.do' with '.jsp'.

That makes sense now. I guess I would really just now like to know how I can make every default call to <something>.do go to index.jsp. Is that even possible?
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to modify url-pattern in your web.xml

Thanks,
[ December 12, 2006: Message edited by: Rajeev Ravindran ]
 
Edgar Castanedo
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe I am trying to do something that JSF was not meant for. What I am trying to do is create a way to always have any call to *.do (which is currently mapped to JSF) to resolve to the same JSP file (index.jsp)... always.

I don't want to have to create a jsp file for each and every *.do.

My index.jsp is like a template file that then acts like a view resolver using the * of *.do.

Does that make sense?
 
Edgar Castanedo
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have another question, are there any good view/template technologies for JSF? Is there anything built in or something open source? I do not want to use tiles, as I am trying to move away from any struts dependencies.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!