how to dynamically include all creator js files.

View: New views
2 Messages — Rating Filter:   Alert me  

how to dynamically include all creator js files.

by Philip A. Senger :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

I need some help with DWR 2.XX regarding the JS includes and creatorManager.

 

We have almost 30 DWR services (growing at a maddening speed). Once every two weeks someone decides to rename or deprecate a service, and forgets to modify the default.jsp that includes the all JS files for the services… So… I decided to dynamically include them in a default JSP… problem is I’ve been writing so much JavaScript lately I’ve become Java and JSP stupid.

 

Here is what I got so far…

 

[ jsp – code ]

<%

 

  for (java.util.Iterator it = creatorManager.getCreatorNames().iterator(); it.hasNext();)

   {

       String name = (String) it.next();

       String interfaceURL = request.getContextPath() + request.getServletPath() + "/interface/" + name + ".js";

       out.println("<script type='text/javascript' src='" + interfaceURL + "'></script>");

   }

 

%>

 

I based this on the DWRServlet code that builds the test page.

 

Can someone help me figure out how to get the creatorManager from the main DWR Servlet we are using Spring?

 

Thanks,

Phil

 


Re: how to dynamically include all creator js files.

by David Marginian-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Check the following threads:
http://www.nabble.com/how-to-get-an-object-of-a-class-known-to-dwr-from-server-td16124194.html
http://www.nabble.com/DWR-config-information-to17052988.html#a17078179

Philip A. Senger wrote:

>
> I need some help with DWR 2.XX regarding the JS includes and
> creatorManager.
>
> We have almost 30 DWR services (growing at a maddening speed). Once
> every two weeks someone decides to rename or deprecate a service, and
> forgets to modify the default.jsp that includes the all JS files for
> the services… So… I decided to dynamically include them in a default
> JSP… problem is I’ve been writing so much JavaScript lately I’ve
> become Java and JSP stupid.
>
> Here is what I got so far…
>
> [ jsp – code ]
>
> <%
>
> for (java.util.Iterator it =
> creatorManager.getCreatorNames().iterator(); it.hasNext();)
>
> {
>
> String name = (String) it.next();
>
> String interfaceURL = request.getContextPath() +
> request.getServletPath() + "/interface/" + name + ".js";
>
> out.println("<script type='text/javascript' src='" + interfaceURL +
> "'></script>");
>
> }
>
> %>
>
> I based this on the DWRServlet code that builds the test page.
>
> Can someone help me figure out how to get the creatorManager from the
> main DWR Servlet we are using Spring?
>
> Thanks,
>
> Phil
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

LightInTheBox - Buy quality products at wholesale price