• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

test.jsf works test.jsp doesn't

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

I'm new here & relatively new to java. I've been at it in SAP for the last year or so & i've been quite protected from real Java. So now i want to get my teeth into something...

I have been trying to understand the best way to put dynamic data into my .jsp page & found out that JSF is the way forward...right? I managed to find a tutorial working first time (pretty much) with test.jsf (even though i generated a test.jsp file according to eclipse). However i want it to display as test.jsp on my URL & that's how i would like to navigate to it through from other pages.

Is this possible? I have tried playing with my web.xml & changing the url-pattern, however this just seems to make it throw lots of errors & the faces-context error catching thingy page shows.

Thanks in advance!

Mark
 
Ranch Hand
Posts: 220
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just read this post as a starting point;

https://coderanch.com/t/533197/JSF/java/HTML-JSP-start-JSF-page

Tuna TÖRE
 
Mark Kelsall
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, i read the other post, however it doesn't quite make sense yet.

In my web.xml i have the following...



If i navigate to http://localhost:8080/mywebapp/jsf/test.jsp it tells me that the FacesContext cannot be found, however if i navigate to http://localhost:8080/mywebapp/jsf/test.jsf it finds the page & displays the contents correctly.

Thanks

Mark
 
Greenhorn
Posts: 12
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried to change the pattern to *.jsp ? This way, all your JSP's will be interpreted as JSF files and processed by Faces Servlet. But I don't know if that is advisable.

In my application, I use xhtml files and the url pattern is *.xhtml
 
Mark Kelsall
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Emmanuel,

Yeah i've tried changing it to *.jsp, unfortunately that just throws lots of errors.

I think that is the sort of thing i am looking for, best practices, things like using *.xhtml

Does that mean that when you a coding links to & from jsp pages with JSF in them, you link to .xhtml?

An example maybe:

create test.jsp page with JSF in, in my folder in my web app.
from another jsp page (say hello.jsp), an <a> tag would be:

<a href="http://localhost:8080/mywebapp/test.xhtml">to test</a>

Thanks

Mark
 
I am Arthur, King of the Britons. And this is a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic