Jump to content
We've recently updated our Privacy Statement, available here ×

How do we integrate HTML pages in JS?


chris_andre

Recommended Posts

Hello everybody,

 

I have created an application with GWT (Google Web Toolkit) and I don't know how to integrate HTML files in JS.

Indeed, one could think that adding a folder with the pages inside would be sufficient but unfortunately, the configuration of the DispatcherServlet makes it catch any queries to a resource with the extension *.html.

As the pages are automatically generated by GWT, I can't change their names (to rename it to *.htm for example) or else, I would break the whole application.

Moreover, I need to put these pages within JS so that I can use the ACEGI filter to filter the access to these pages.

I'm sure that Spring experts are used to this kind of silly problem but, as I'm not one, I was wondering if someone could help me with it?

Thanks in advance!

 

Chris

Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

Hi Chris,

 

I don't know if this will point you in the right direction for your app or not. But there are two resources you can try. One is a white paper called "Customizing and Rebranding the JasperSoft User Interface." The section, "Extend a Page Flow" might get you started with some ideas: http://www.jaspersoft.com/re_overview.html#whitepapers.

 

 

The better more comprehensive resource is Chapter 9 of the JasperServer Ultimate Guide. The JS Ultimate Guide is included with JS Pro or you can purchase a copy at http://www.jaspersoft.com/JasperShop_Documentation.html. The Ultimate Guide covers Pro and Community Edition.

 

 

Good luck! I'd love to see what you end up with... :)

 

Mary

Link to comment
Share on other sites

Hey Mary,

 

I had tried the two resources you mention and they work really well as long as we are trying to integrate a non-HTML file.

Unfortunately, the problem caused by the DispatcherServlet prevented me from using HTML files.

Thanks to a great book ("Pro Web 2.0 Application Development with GWT" for those who are interested), I found a solution: change the initialization order of the DispatcherServlet to have it loaded after the default servlet (I am using Tomcat) that I have explicitly mapped to the path of my folder containing my GWT application and the HTML files contained inside are rendered without any problem.

Cheers !

 

Chris

Link to comment
Share on other sites

  • 1 month later...

 I am very interrested by integrating GWT in JS, would you, chris, list there the main problems you discovered mixing both solutions ? It could be interresting to see the difficulties you had before getting mines :)

Can you shortly show us you DispatcherServlet ?

In advance, thank you :)

 

 

 

 

Link to comment
Share on other sites

Actually, I have encountered two problems:

  • The first one is the one I mentioned in this post: the default mapping of the requests to the Spring dispatcher to "*.html" made it very hard to integrate the application at first. I didn't change the DispatcherServlet itself but, in the web.xml, explicitely mapped the queries going to one folder (containing my GWT application's files) to a servlet that just serves the requested files without doing anything else.
  • The second one, probably caused by a wrong configuration of ACEGI (A.K.A. Spring Security) is that, when someone accesses the application, the anonymous user (the one used to access the login page) is associated with the ROLE_USER. I haven't found a solution for the moment as the project (internal project) has been put on hold but I saw that the book I mentioned in the previous posts has some hints on how to integrate ACEGI and GWT.

Hope it helps,

 

Chris



Post Edited by Chris André at 03/13/09 10:17
Link to comment
Share on other sites

  • 6 months later...

 So you created a special servlet ? Or you just used the spring default one ?

Then you had just declared the servlet in the web.xml ? that is right ?

I am going to test, because i have the same troubles deploying my own gwt pages :)

 

 

Link to comment
Share on other sites

I used the default servlet (the one used by default by the application server to serve the static files) and mapped it to my folder and the HTML files inside (with a regular servlet configuration from web.xml).

As I am not familiar with Spring WebFlow, I preferred not to modify the DispatcherServlet.

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...