struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@informatiefabriek.nl
Subject include javascript (urgent)
Date Mon, 07 Jul 2003 13:34:37 GMT
Hi all,

I'm using the Struts framework for my web application.
Unfortunatly I have to include some java-script from an other webserver 
(Lotus Domino).

I have stored the url for the include in a Bean called: URLBean:

package ordermanager.urlbean;
public class URLBean {
        private String scriptFile;
        public String getScriptFile() {
                return scriptFile;
        }
        public void setScriptFile(String string) {
                scriptFile = string;
        }
}

In my first Action I create the URLBean. And I add it to the session 
object using the following code:

URLBean urlBean = new URLBean();
urlBean.setScriptFile(properties.getProperty("script.include"));
request.getSession().setAttribute("urls", urlBean);

Then In my JSP I tried to do this:

<logic:present name="urls">
        <jsp:useBean id="urls" scope="session" class="ordermanager.urlbean
.URLBean" />
        ScriptFile: <bean:write name="urls" property="scriptFile"/> <br/>
</logic:present>

This code works... But I want to use this url in a <script> tag like this:

<script src="<%= urls.getScriptFile() %>"></script>

But when I try this I get a comiple error. Jasper complains that the urls 
object cannot be found.
What am I doing wrong. And what should I do to correct it?

Thanks,

Harm de Laat
Informatiefabriek


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message