struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From René Eigenheer <reigenh...@bridgesolutions.net>
Subject RE: Including file from different server
Date Thu, 12 Sep 2002 15:59:34 GMT
I did something similar the following way:

- using tiles to handle the requirement "on all pages"
- writing either a servlet or a taglib which reads the banner and writes it
to the output stream, code could look something like this:

String url = "http://www.mydomain.com/myBanner.htm";
try {
	StringBuffer sb = new StringBuffer();;
	URL url = new URL(url);
	InputStream in = url.openStream();

	int len;
	byte[] b = new byte[100];
	while ((len = in.read(b)) != -1) {
		sb.append(new String(b).substring(0,len));
	}
	String s = sb.toString();

-> write s to output, or cache it, or ...

	in.close();
} catch (IOException ex) {}



> -----Original Message-----
> From: Khan, Manuchehar A (ACF) [mailto:mkhan@acf.hhs.gov]
> Sent: Donnerstag, 12. September 2002 17:02
> To: 'Struts Users Mailing List'
> Subject: Including file from different server
>
>
> How can we add a page that resides on different server in all
> of our pages
> as banner.
>
>
> -----Original Message-----
> From: Donald Ball [mailto:dball@rhoworld.com]
> Sent: Thursday, September 12, 2002 10:52 AM
> To: struts-user@jakarta.apache.org
> Subject: accessing path information from a jsp page
>
>
> In my jsp page, I want to know one or more of these things:
>
> * the incoming URL
> * the path of the ActionMapping the incoming URL was mapped to
> * the path and name of the view (the jsp page) to which the
> request was
> forwarded
>
> presumably i can get the first by querying the request -
> something like:
>
> <bean:write name="request" property="requestURI"/>
>
> no idea about the others. Any suggestions?
>
> - donald
>
>
> --
> To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
>
>


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


Mime
View raw message