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

Key: IDEADEV-6433
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Maxim Shafirov
Reporter: AlexL
Votes: 1
Watchers: 3
Operations

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

JSP : The Java Indenter and Formatter are completely wrong when <% %> is enclosed by a <script> tag.

Created: 12 Dec 05 07:22   Updated: 06 Nov 08 23:33
Component/s: Code Formatting and Code Style
Fix Version/s: Undefined

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Windows XP SP2

Build: 4,069
Severity: High


 Description  « Hide
The JSP formatter and indentation has a bunch of problems.
Here is one easy to describe. If I have some java code inside <% %> block that is
enclosed by <script> tag, then the java formatter and indenter does nothing. There is no indentation.
If I reformat, the formatter leaves the lines as is.
JSP
<html>
<body>
<script type="text/javascript">
    var a = 1;
    var b = 2;
<%
String url = "...";
Boolean c = (Boolean) session.getAttribute("c");
if (c.booleanValue()) {
response.sendRedirect(url);
} else {
// continue..
}
 %>
</script>
</body>
</html>


 All   Comments   Work Log   Change History      Sort Order:
AlexL - 25 Jan 06 04:21
Slightly different behavior in 4125, but still has a bug. After reformat, the <% %> block is indented one level below
<script> tag. But the java code is still not being formatted.

This new behavior is actually unwanted. I would like <% and %> to always be in column 1.

<html>
<body>
<script type="text/javascript">
    var a = 1;
    var b = 2;
    <%
   String url = "...";
   Boolean c = (Boolean) session.getAttribute("c");
   if (c.booleanValue()) {
   response.sendRedirect(url);
   } else {
   // continue..
   }
    %>
</script>
</body>
</html>