This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 200871 - Servlet from template is incorrectly formatted
Summary: Servlet from template is incorrectly formatted
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: Editing infrastructure (show other bugs)
Version: 7.1
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: Marek Fukala
URL:
Keywords: TEST
: 201503 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-08-11 12:38 UTC by Jiri Skrivanek
Modified: 2011-09-29 07:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2011-08-11 12:38:11 UTC
Probably because of new formatter rules is a new servlet created from template incorrectly formatted. I get this

    /**      * Processes requests for both HTTP
     * <code>GET</code> and
     * <code>POST</code> methods.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try {
            /*
             * TODO output your page here out.println("<html>");
             * out.println("<head>"); out.println("<title>Servlet
             * NewServlet</title>"); out.println("</head>");
             * out.println("<body>"); out.println("<h1>Servlet NewServlet at " +
             * request.getContextPath () + "</h1>"); out.println("</body>");
             * out.println("</html>");
             */
        } finally {            
            out.close();
        }
    }
Comment 1 Jiri Skrivanek 2011-09-01 07:53:29 UTC
*** Bug 201503 has been marked as a duplicate of this bug. ***
Comment 2 David Konecny 2011-09-06 22:11:56 UTC
This is quite a nuisance as Servlet wizard is used frequently in all sorts of testing. Thanks for fixing it.
Comment 3 Marek Fukala 2011-09-21 10:41:18 UTC
the servlet generated in today's build looks ok to me, marking as fixed
Comment 4 Jiri Skrivanek 2011-09-21 12:29:52 UTC
No. It doesn't work for me in latest daily build neither in custom build 20110921-342970572357. I would suggest to remove comment tags /* */ and keep the code uncommented by default:

  // TODO output your page here 
  out.println("<html>");
  out.println("<head>");
  out.println("<title>Servlet NewServlet</title>");
  out.println("</head>");
  out.println("<body>");
  out.println("<h1>Servlet NewServlet at " + request.getContextPath() + "</h1>");
  out.println("</body>");
  out.println("</html>");
Comment 5 Marek Fukala 2011-09-21 19:07:29 UTC
Ah, I though you were complaining about the  following part:

/**      * Processes requests for both HTTP
     * <code>GET</code> and

I noticed the bit weird two command lines, but considered this as a minor issue. If it is a P2 I'll fix it likely by changing the /* */ comment to the line comment style.
Comment 6 David Konecny 2011-09-21 19:37:16 UTC
+1 on #4

I marked it as P2 (so that's not forgotten) because I'm using this wizard for testing pretty much every day and this formatting change (apart from being ugly) made it much harder to get a servlet which prints something and be able to quickly change what gets printed. :-) Previously it was easy to uncomment it but on second thought #4 is even better solution.
Comment 7 Marek Fukala 2011-09-26 08:55:18 UTC
fixed in web-main#f466a5fcf73b
Comment 8 Quality Engineering 2011-09-27 14:12:31 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/f466a5fcf73b
User: Marek Fukala <mfukala@netbeans.org>
Log: #200871 - Servlet from template is incorrectly formatted