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 7913297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:48:34+00:00 2026-06-03T13:48:34+00:00

I have a JSF 2.0 Webapplication into which I d’like to include TinyMCE 3.5.

  • 0

I have a JSF 2.0 Webapplication into which I d’like to include TinyMCE 3.5.

The way I included it is like below:

<composite:implementation>
    <h:outputScript name="tiny_mce/tiny_mce.js"/>
    <h:outputScript name="js/tinymce_init.js"/>
    <h:inputTextarea rows="5" cols="80" styleClass="tinymce" value="#{cc.attrs.value}"/>
</composite:implementation>

Now everything works fine. The only problem I have is that “tiny_mce.js” has some references to other js files in the tiny_mce folder. These references return a 404 error, because they have no .xhtml ending.

Example: tiny_mce.js references en.js. Its trying to load it from “http://localhost:8080/briefe/javax.faces.resource/js/tiny_mce/langs/en.js“. If I enter this URL into the Browser I get a 404. If I add .xhtml in the end (“http://localhost:8080/briefe/javax.faces.resource/js/tiny_mce/langs/en.js.xhtml“) everything works great.

So I d like to ask you, if there is a way I can add xhtml as default ending for .js files or if there is a way to make .js files accessible.

  • 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-06-03T13:48:34+00:00Added an answer on June 3, 2026 at 1:48 pm

    The <h:outputScript> will generate a JSF resource URL which is handled by ResourceHandler which in turn allows modularization and versioning without the need to ever change the <h:outputScript name>. When the FacesServlet is mapped on *.xhtml, the resource URL will look like this

    /contextname/javax.faces.resource/filename.js.xhtml

    The TinyMCE scripts are apparently auto-including some other scripts based on the script’s own URL and not taking the .xhtml suffix into account.

    /contextname/javax.faces.resource/otherfile.js

    This will then indeed result in 404s. When you’re using a prefix mapping for the FacesServlet like /faces/*, then this problem will not occur.

    One solution is to hardcode the <script> with the desired URL yourself. The right substitute would then be

    <script type="text/javascript" src="#{request.contextPath}/resources/tiny_mce/tiny_mce.js"/>
    <script type="text/javascript" src="#{request.contextPath}/resources/js/tinymce_init.js"/>
    

    The only disadvantage is, when you’re using multiple composite components in a single view, then you’d end up with multiple <script> entries in the body instead of only one as taken care by <h:outputScript>. This may end up in JavaScript conflicts/errors. If you encounter this problem, I’d consider to hack/fix the TinyMCE JavaScript file accordingly that it adds the .xhtml suffix to the URL, so that you can keep using <h:outputScript>. Or, you can of course use an existing and ready-to-use JSF rich text editor component such as PrimeFaces <p:textEditor>, so that you don’t need to worry about this all.

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

Sidebar

Related Questions

i have Web Application which should use JSF 2.0 libraries included in WEB-INF/lib... but
I have a Java-JSF Web Application on GlassFish, in which I want to use
I have JSF code like: <h:inputText id=from value=#{fromToMBean.fromName}/> I would like to get this
I have a JSF 2.0 composite component as follows: <composite:interface> <composite:attribute name=id/> <composite:attribute name=action1
I have a JSF application that uses mostly Richfaces. I would like to introduce
I have this seemingly-innocent code on my main JSF page: <a4j:outputPanel id=sidebarContainer> <a4j:include viewId=#{UserSession.currentSidebar}/>
I am developing an application in JSF 2.0 and I would like to have
I have a Java EE 6 application in which I'd like to use velocity
I have got a web application which is speparated in a GUI (JSF 2.0,
I have a web application in which we use JSF framework. I have been

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.