You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Bryce Nesbitt (JIRA)" <ji...@apache.org> on 2005/12/17 18:51:34 UTC

[jira] Created: (VELOCITY-427) Content-Length in HTTP headers messed up by Velocimacro #macro definition

Content-Length in HTTP headers messed up by Velocimacro #macro definition 
--------------------------------------------------------------------------

         Key: VELOCITY-427
         URL: http://issues.apache.org/jira/browse/VELOCITY-427
     Project: Velocity
        Type: Bug
    Versions: 1.3.1    
 Environment: SUSE 10.0 Linux
Jakarta Velocity v1.3.1
Apache Tomcat/5.0  	Java 1.4.2_06-b03  	Sun Microsystems Inc.  	Linux  	2.6.13-15.7-default  	i386
    Reporter: Bryce Nesbitt


I'm rather confused by this.  If my velocity pages have a #macro definition in them, the HTTP header Content-Length: is messed up.  A very simple macro shows this.  The content length is 350 bytes, but only 249 bytes will be served.  This causes some clients to work fine, others to blow chunks (that's a technical term :-).

-----------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

#macro( screwthingsupmacro $values )
    <p>I cause the Content-Length: header to be wrong!</p>
#end

<html>
<head>
    <title>Individual Member Application</title>
</head>
<body>
<form action="signup.action" method="POST">
</form>
</body>
</html>


-----------------------------------------------
host> wget --save-headers http://localhost:8080/exploded/signup/e_test.html

HTTP request sent, awaiting response... 200 OK
Length: 350 [text/html]
71% [=========================>           ] 249           --.--K/s   
ETA 00:02
Connection closed at byte 249. Retrying.


----------------------------------------
2005-12-17 09:42:43,049 - SimpleLog4JLogSystem initialized using logfile 'velocity.log'
2005-12-17 09:42:43,049 - SimpleLog4JLogSystem initialized using logfile 'velocity.log'
2005-12-17 09:42:43,049 - **************************************************************
2005-12-17 09:42:43,049 - **************************************************************
2005-12-17 09:42:43,050 - Starting Jakarta Velocity v1.3.1
2005-12-17 09:42:43,050 - Starting Jakarta Velocity v1.3.1
2005-12-17 09:42:43,050 - RuntimeInstance initializing.
2005-12-17 09:42:43,050 - RuntimeInstance initializing.
2005-12-17 09:42:43,050 - Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
2005-12-17 09:42:43,050 - Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
2005-12-17 09:42:43,050 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogSystem
2005-12-17 09:42:43,050 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogSystem
 ....
2005-12-17 09:42:49,100 - ResourceManager : found test.html with loader org.apache.velocity.runtime.resource.loader.FileResourceLoader
2005-12-17 09:42:49,100 - ResourceManager : found test.html with loader org.apache.velocity.runtime.resource.loader.FileResourceLoader


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Resolved: (VELOCITY-427) Content-Length in HTTP headers messed up by Velocimacro #macro definition

Posted by "Will Glass-Husain (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/VELOCITY-427?page=all ]
     
Will Glass-Husain resolved VELOCITY-427:
----------------------------------------

    Resolution: Invalid

I'm going to mark this invalid as it's unlikely a direct Velocity issue.  If you post to the velocity-user list we can try to help you.

Remember that Velocity can be used in many different ways.  If you are using the VelocityServlet or VelocityViewServlet, please say so.  Or indicate how Velocity is being called.


> Content-Length in HTTP headers messed up by Velocimacro #macro definition
> -------------------------------------------------------------------------
>
>          Key: VELOCITY-427
>          URL: http://issues.apache.org/jira/browse/VELOCITY-427
>      Project: Velocity
>         Type: Bug
>     Versions: 1.3.1
>  Environment: SUSE 10.0 Linux
> Jakarta Velocity v1.3.1
> Apache Tomcat/5.0  	Java 1.4.2_06-b03  	Sun Microsystems Inc.  	Linux  	2.6.13-15.7-default  	i386
>     Reporter: Bryce Nesbitt

>
> I'm rather confused by this.  If my velocity pages have a #macro definition in them, the HTTP header Content-Length: is messed up.  A very simple macro shows this.  The content length is 350 bytes, but only 249 bytes will be served.  This causes some clients to work fine, others to blow chunks (that's a technical term :-).
> -----------------------------------------------
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> #macro( screwthingsupmacro $values )
>     <p>I cause the Content-Length: header to be wrong!</p>
> #end
> <html>
> <head>
>     <title>Individual Member Application</title>
> </head>
> <body>
> <form action="signup.action" method="POST">
> </form>
> </body>
> </html>
> -----------------------------------------------
> host> wget --save-headers http://localhost:8080/exploded/signup/e_test.html
> HTTP request sent, awaiting response... 200 OK
> Length: 350 [text/html]
> 71% [=========================>           ] 249           --.--K/s   
> ETA 00:02
> Connection closed at byte 249. Retrying.
> ----------------------------------------
> 2005-12-17 09:42:43,049 - SimpleLog4JLogSystem initialized using logfile 'velocity.log'
> 2005-12-17 09:42:43,049 - SimpleLog4JLogSystem initialized using logfile 'velocity.log'
> 2005-12-17 09:42:43,049 - **************************************************************
> 2005-12-17 09:42:43,049 - **************************************************************
> 2005-12-17 09:42:43,050 - Starting Jakarta Velocity v1.3.1
> 2005-12-17 09:42:43,050 - Starting Jakarta Velocity v1.3.1
> 2005-12-17 09:42:43,050 - RuntimeInstance initializing.
> 2005-12-17 09:42:43,050 - RuntimeInstance initializing.
> 2005-12-17 09:42:43,050 - Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
> 2005-12-17 09:42:43,050 - Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
> 2005-12-17 09:42:43,050 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogSystem
> 2005-12-17 09:42:43,050 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogSystem
>  ....
> 2005-12-17 09:42:49,100 - ResourceManager : found test.html with loader org.apache.velocity.runtime.resource.loader.FileResourceLoader
> 2005-12-17 09:42:49,100 - ResourceManager : found test.html with loader org.apache.velocity.runtime.resource.loader.FileResourceLoader

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (VELOCITY-427) Content-Length in HTTP headers messed up by Velocimacro #macro definition

Posted by "Bryce Nesbitt (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/VELOCITY-427?page=comments#action_12360709 ] 

Bryce Nesbitt commented on VELOCITY-427:
----------------------------------------

It appears to be the fault of Xwork.  Grr.


> Content-Length in HTTP headers messed up by Velocimacro #macro definition
> -------------------------------------------------------------------------
>
>          Key: VELOCITY-427
>          URL: http://issues.apache.org/jira/browse/VELOCITY-427
>      Project: Velocity
>         Type: Bug
>     Versions: 1.3.1
>  Environment: SUSE 10.0 Linux
> Jakarta Velocity v1.3.1
> Apache Tomcat/5.0  	Java 1.4.2_06-b03  	Sun Microsystems Inc.  	Linux  	2.6.13-15.7-default  	i386
>     Reporter: Bryce Nesbitt

>
> I'm rather confused by this.  If my velocity pages have a #macro definition in them, the HTTP header Content-Length: is messed up.  A very simple macro shows this.  The content length is 350 bytes, but only 249 bytes will be served.  This causes some clients to work fine, others to blow chunks (that's a technical term :-).
> -----------------------------------------------
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> #macro( screwthingsupmacro $values )
>     <p>I cause the Content-Length: header to be wrong!</p>
> #end
> <html>
> <head>
>     <title>Individual Member Application</title>
> </head>
> <body>
> <form action="signup.action" method="POST">
> </form>
> </body>
> </html>
> -----------------------------------------------
> host> wget --save-headers http://localhost:8080/exploded/signup/e_test.html
> HTTP request sent, awaiting response... 200 OK
> Length: 350 [text/html]
> 71% [=========================>           ] 249           --.--K/s   
> ETA 00:02
> Connection closed at byte 249. Retrying.
> ----------------------------------------
> 2005-12-17 09:42:43,049 - SimpleLog4JLogSystem initialized using logfile 'velocity.log'
> 2005-12-17 09:42:43,049 - SimpleLog4JLogSystem initialized using logfile 'velocity.log'
> 2005-12-17 09:42:43,049 - **************************************************************
> 2005-12-17 09:42:43,049 - **************************************************************
> 2005-12-17 09:42:43,050 - Starting Jakarta Velocity v1.3.1
> 2005-12-17 09:42:43,050 - Starting Jakarta Velocity v1.3.1
> 2005-12-17 09:42:43,050 - RuntimeInstance initializing.
> 2005-12-17 09:42:43,050 - RuntimeInstance initializing.
> 2005-12-17 09:42:43,050 - Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
> 2005-12-17 09:42:43,050 - Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
> 2005-12-17 09:42:43,050 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogSystem
> 2005-12-17 09:42:43,050 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogSystem
>  ....
> 2005-12-17 09:42:49,100 - ResourceManager : found test.html with loader org.apache.velocity.runtime.resource.loader.FileResourceLoader
> 2005-12-17 09:42:49,100 - ResourceManager : found test.html with loader org.apache.velocity.runtime.resource.loader.FileResourceLoader

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Closed: (VELOCITY-427) Content-Length in HTTP headers messed up by Velocimacro #macro definition

Posted by "Henning Schmiedehausen (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henning Schmiedehausen closed VELOCITY-427.
-------------------------------------------


> Content-Length in HTTP headers messed up by Velocimacro #macro definition
> -------------------------------------------------------------------------
>
>                 Key: VELOCITY-427
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-427
>             Project: Velocity
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>         Environment: SUSE 10.0 Linux
> Jakarta Velocity v1.3.1
> Apache Tomcat/5.0  	Java 1.4.2_06-b03  	Sun Microsystems Inc.  	Linux  	2.6.13-15.7-default  	i386
>            Reporter: Bryce Nesbitt
>
> I'm rather confused by this.  If my velocity pages have a #macro definition in them, the HTTP header Content-Length: is messed up.  A very simple macro shows this.  The content length is 350 bytes, but only 249 bytes will be served.  This causes some clients to work fine, others to blow chunks (that's a technical term :-).
> -----------------------------------------------
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> #macro( screwthingsupmacro $values )
>     <p>I cause the Content-Length: header to be wrong!</p>
> #end
> <html>
> <head>
>     <title>Individual Member Application</title>
> </head>
> <body>
> <form action="signup.action" method="POST">
> </form>
> </body>
> </html>
> -----------------------------------------------
> host> wget --save-headers http://localhost:8080/exploded/signup/e_test.html
> HTTP request sent, awaiting response... 200 OK
> Length: 350 [text/html]
> 71% [=========================>           ] 249           --.--K/s   
> ETA 00:02
> Connection closed at byte 249. Retrying.
> ----------------------------------------
> 2005-12-17 09:42:43,049 - SimpleLog4JLogSystem initialized using logfile 'velocity.log'
> 2005-12-17 09:42:43,049 - SimpleLog4JLogSystem initialized using logfile 'velocity.log'
> 2005-12-17 09:42:43,049 - **************************************************************
> 2005-12-17 09:42:43,049 - **************************************************************
> 2005-12-17 09:42:43,050 - Starting Jakarta Velocity v1.3.1
> 2005-12-17 09:42:43,050 - Starting Jakarta Velocity v1.3.1
> 2005-12-17 09:42:43,050 - RuntimeInstance initializing.
> 2005-12-17 09:42:43,050 - RuntimeInstance initializing.
> 2005-12-17 09:42:43,050 - Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
> 2005-12-17 09:42:43,050 - Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
> 2005-12-17 09:42:43,050 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogSystem
> 2005-12-17 09:42:43,050 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogSystem
>  ....
> 2005-12-17 09:42:49,100 - ResourceManager : found test.html with loader org.apache.velocity.runtime.resource.loader.FileResourceLoader
> 2005-12-17 09:42:49,100 - ResourceManager : found test.html with loader org.apache.velocity.runtime.resource.loader.FileResourceLoader

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org