You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Da...@ovid.com on 2001/04/10 17:53:12 UTC

RE: dynamically constructing non-jsp pages

Actually, it works quite well for *.js.  One nice use of it is if you want
to have an internationalized .js script (Say for instance you have alert
messages that you want to be able to display in different languages).  By
configuring your servlet container to process .js files as though they were
jsp files, you can add custom tags that point to internationalized
messages.  That is one of the nice things about jsp, is you can use it to
create much more than just html, and when you customize your javascript
files based on specific information from the server, you have a lot more
control and options.
Just my 2 cents.
-Dallas


                                                                                                                  
                    Martijn Spronk                                                                                
                    <spronk@columbus        To:     "'struts-user@jakarta.apache.org'"                            
                    group.com>              <st...@jakarta.apache.org>                                      
                                            cc:                                                                   
                    03/14/01 10:01          Fax to:                                                               
                    AM                      Subject:     RE: dynamically constructing non-jsp pages               
                    Please respond                                                                                
                    to struts-user                                                                                
                                                                                                                  
                                                                                                                  




I assume one way should be by configuring your servlet/JSP
engine. For example in Resin, jsp files are processed by the
JspServlet servlet because of the mapping:

<servlet-mapping url-pattern='*.jsp'
servlet-name='com.caucho.jsp.JspServlet'/>

I don't see why this wouldn't work for *.js.

Martijn.



Martijn Spronk
spronk@columbusgroup.com
www.columbusgroup.com
604.801.5758 ext. 248
Vancouver + Toronto + Seattle


-----Original Message-----
From: Andre_Beskrowni@enron.net [mailto:Andre_Beskrowni@enron.net]
Sent: March 14, 2001 8:51 AM
To: struts-user@jakarta.apache.org
Subject: dynamically constructing non-jsp pages




first, let me say that this is not necessarily struts-specific, but since
i'm
pretty much using struts exclusively these days, and this list generates so
much
more useful info than the sun jsp and servlet list, i decided to try here
first.

here's my situation, i would like query a database and load the results for
some
reference tables into .js files, where they can then be quickly accessed
for
client side validation.  (not an ideal solution, i know, but it would take
me
along time to explain why we came to this decision.)  i realize i can do
this
the hard way by directly printing out the response in the servlet, but i'd
like
to avoid that if possible.  is there a way to dynamically load a page and
not
have it end with the .jsp suffix?

thanks,

ab