Eclipse webtools project (WTP) and its performance / quality

后端 未结 11 1652
别那么骄傲
别那么骄傲 2021-01-30 05:01

Our company is using eclipse since several years now (we are using WTP since release 0.7)

I am currently evaluating eclipse 3.6.2 with WTP 3.2.3 which s

11条回答
  •  情书的邮戳
    2021-01-30 05:47

    I've disabled the WTP JSP editor for the reasons you mentioned above: It just needs too many resources. Some more things you should consider:

    1. Edit JSPs in the normal HTML editor. That means you don't get code completion which is a good thing. IMO, Mixing Java and HTML is a mistake in the first place and an editor can't fix that. Put all Java code into helper beans (which you can then test easily) and just access the beans from JSP. This should get rid of 99% of all the <% %> tags and solve most of your problems already.

    2. Consider using Spring to be able to build more complex beans and inject them into your JSPs using these patterns:

      • How to inject spring beans into a jsp 2.0 SimpleTag?
      • Use SpringBeanAutowiringSupport:

        <%!
            @Autowired
            private Bean bean;
        
            public void jspInit() {
                SpringBeanAutowiringSupport
                .processInjectionBasedOnServletContext( 
                    this, getServletContext()
                );
            }
        %>
        
    3. Try a different VM. WTP editors creates huge amounts of objects and now all VMs (GC implementations) can handle that equally well. If you use Sun's Java, try JRockit or IBMs J9. Also play with the GC settings. Increasing RAM won't help because if you have GC issues, more RAM usually only makes it worse (since the GC will have to process more data).

    4. Precompile as much code as possible. You don't need 4000 classes open at all times on your workspace. Cut your huge project into manageable chunks.

    5. Replace JSPs with plain Java servlets and use HTML rendering libraries like rendersnake or use a programming language which plays more nice with HTML (like Groovy).

    6. Get some decent hardware. A new PC with a quad core and 8GB RAM costs $1000. If you save ten minutes every day, the investment will be paid up in 50 days (at the rate of 1 person costs $1000/day all in all).

    7. Try MyEclipse which has much better web editors. The JSP editor is better than WTP (code completion works most of the time, for example) but it's still sluggish.

提交回复
热议问题