History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-26144
Type: Bug Bug
Status: Open Open
Priority: Normal Normal
Assignee: Maxim Shafirov
Reporter: Vincent Chan
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

JSP formatter produces wrong results

Created: 18 Apr 08 20:08   Updated: 05 Aug 08 19:21
Component/s: Code Formatting and Code Style, J2EE.JSP
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 8,280


 Description  « Hide
In jsp Editor,when I lose one end tag in java code ( } for example ) and format the code.then the code after that will be formatted by words.
That is one word one line.And then It cannot be formatted automatically.

 All   Comments   Work Log   Change History      Sort Order:
Alexander Chernikov - 18 Apr 08 20:41
8309: cannot reproduce it with code like:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head><title>Title</title></head>
<body>
Some text before.
<c:out value="${header.any"/>
Some text after.
</body>
</html>

Please, provide a sample of code which is formatted badly for you.


Vincent Chan - 19 Apr 08 16:00 - edited
I am sorry.It 's not lose some "}",but got a surplus "}" like
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head><title>Title</title></head>
<body>
Some text before.
<%
    if (true) {
        out.println("Here");//
    }
    }//one more } here
%>
Some text here!
<%
//after format.These code become:
    System
    .
    out
    .
    println
    (
    "asd"
    )
    ;
%>
</body>
</html>

(I know it not a good idea to mix the java code in jsp.But we've got some legacy codes)
By the way,where 's the 8309


Alexander Chernikov - 21 Apr 08 17:54
Thanks a lot. Reproduced in 8314 (some EAP build will be available later).

The source code was:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head><title>Title</title></head>
<body>
Some text before.
<%
	if (true) {
		out.println("Here");//
	}
	}//one more } here
%>
Some text here!
<%
	//after format.These code become:
	System.out.println("asd");
%>
</body>
</html>