Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 793699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:11:39+00:00 2026-05-14T22:11:39+00:00

I’m new to both JSF and Spring Framework and I’m trying to figure out

  • 0

I’m new to both JSF and Spring Framework and I’m trying to figure out how to make them work together.
My current problem is that application outputs my JSF files without interpreting them.
Here are some snippets of my code which I believe might be relevant:

dispatcher-servlet.xml

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="mappings">
        <props>
            <prop key="login.htm">loginController</prop>
        </props>
    </property>
</bean>

<bean id="viewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"
      p:prefix="/WEB-INF/pages/"
      p:suffix=".xhtml" />

<bean name="loginController" class="controller.LoginController" />

loginController

public class LoginController extends MultiActionController {
 public ModelAndView login(HttpServletRequest request,
   HttpServletResponse response) throws Exception {
    System.out.println("LOGIN");
    return new ModelAndView("login");
}

WEB-INF/pages/login.xhtml

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html">
<h:head>
    <title>#{message.log}</title>
</h:head>
<h:body>
    <h:form>
        <h:outputLabel value="#{message.username}" for="userName">
            <h:inputText id="userName" value="#{User.name}" />
        </h:outputLabel>            
        <h:commandButton value="#{message.loggin}" action="#{User.login}" />
    </h:form>
</h:body>
</html>

Any ideas where the problem might be? Does this code make any sense at all? I’m well aware of fact, that probably completely sucks and I’ll be glad to here WHY it sucks and how to make it better. Thanks 🙂

EDIT: I’m adding piece of code which seems to be the root of the problem and which I (of course) didn’t include in the original question:

web.xml

<servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>2</load-on-startup>
</servlet>
<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>*.htm</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>

The url-pattern of Faces Servlet had to be changed to *.xhtml in order to work properly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T22:11:40+00:00Added an answer on May 14, 2026 at 10:11 pm

    If the JSF tags are not been parsed, then it simply means that the request URL did not match the url-pattern of the FacesServlet as definied in web.xml. It is namely responsible for all that JSF happenings. You need to verify if the request URL matches the url-pattern of the FacesServlet. If it is for example *.jsf, then you need to invoke it by http://example.com/context/page.jsf and thus not by http://example.com/context/page.xhtml.

    I am however not sure how Spring fits in the picture since I don’t use it, but to get JSF to work you really need to pass the request through the FacesServlet first, not through some Spring controller. Spring should do its job thereafter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I want use html5's new tag to play a wav file (currently only supported
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to loop through a bunch of documents I have to put
I've got a string that has curly quotes in it. I'd like to replace
I'm looking for suggestions for debugging... If you view this site in Firefox or
I have a jquery bug and I've been looking for hours now, I can't
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.