Discussions

Web tier: servlets, JSP, Web frameworks: display Struts with .html extension

  1. display Struts with .html extension (2 messages)

    To all:
    I am trying to find a way to display a dynamic web page created with Struts so that it would have an .html extension so that I can send the page by email. My goal is to create a report using Struts and once the report is created on the server have it displayed on the client but instead of having a .do extension have it displayed as a regular html web page. I found that if the url shows the .do extension I could not send it as email.
    Is there some simle and elegant way of doing this?

    Thank you for all your help.
  2. display Struts with .html extension[ Go to top ]

    You could add an entry into the web.xml file right below the entry that looks like
      <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
      </servlet-mapping>
    that says
      <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.html</url-pattern>
      </servlet-mapping>
    of course that would mean that if you had any actual html files in the application it would try to route them to struts too.
  3. display Struts with .html extension[ Go to top ]

    Thank you for your reply. After alot of experimenting I found out that file extension had nothing to do with it. It might have been either a browser setting or a security issue. While testing locally on my PC I was able to email without a problem. Once I deployed my project to the test server and ran it, something was preventing me to email the page.