[seam-commits] Seam SVN: r7587 - trunk/src/remoting/org/jboss/seam/remoting.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Fri Mar 14 19:28:16 EDT 2008
Author: shane.bryzak at jboss.com
Date: 2008-03-14 19:28:16 -0400 (Fri, 14 Mar 2008)
New Revision: 7587
Modified:
trunk/src/remoting/org/jboss/seam/remoting/InterfaceGenerator.java
trunk/src/remoting/org/jboss/seam/remoting/Remoting.java
Log:
JBSEAM-2745
Modified: trunk/src/remoting/org/jboss/seam/remoting/InterfaceGenerator.java
===================================================================
--- trunk/src/remoting/org/jboss/seam/remoting/InterfaceGenerator.java 2008-03-14 22:06:52 UTC (rev 7586)
+++ trunk/src/remoting/org/jboss/seam/remoting/InterfaceGenerator.java 2008-03-14 23:28:16 UTC (rev 7587)
@@ -76,6 +76,8 @@
String[] componentNames = request.getQueryString().split("&");
Component[] components = new Component[componentNames.length];
Set<Type> types = new HashSet<Type>();
+
+ response.setContentType("text/javasript");
for (int i = 0; i < componentNames.length; i++)
{
Modified: trunk/src/remoting/org/jboss/seam/remoting/Remoting.java
===================================================================
--- trunk/src/remoting/org/jboss/seam/remoting/Remoting.java 2008-03-14 22:06:52 UTC (rev 7586)
+++ trunk/src/remoting/org/jboss/seam/remoting/Remoting.java 2008-03-14 23:28:16 UTC (rev 7587)
@@ -120,7 +120,7 @@
if (REMOTING_RESOURCE_PATH.equals(path))
{
- writeResource(resource, response.getOutputStream());
+ writeResource(resource, response);
if ("remote.js".equals(resource))
{
appendConfig(response.getOutputStream(), request
@@ -159,22 +159,24 @@
* @param resourceName String
* @param out OutputStream
*/
- private void writeResource(String resourceName, OutputStream out)
+ private void writeResource(String resourceName, HttpServletResponse response)
throws IOException
{
// Only allow resource requests for .js files
if (resourceName.endsWith(".js"))
- {
+ {
InputStream in = this.getClass().getClassLoader().getResourceAsStream(
"org/jboss/seam/remoting/" + resourceName);
if (in != null)
{
+ response.setContentType("text/javascript");
+
byte[] buffer = new byte[1024];
int read = in.read(buffer);
while (read != -1)
{
- out.write(buffer, 0, read);
+ response.getOutputStream().write(buffer, 0, read);
read = in.read(buffer);
}
}
More information about the seam-commits
mailing list