Automatic re-compilation of JSPs and tags

Answered

Hi!

Thanks guys for a great product. I have recently switched from Eclipse 3.5 to IntelliJ IDEA 9.0.2 and I'm quite impressed, especially with the comprehensive syntax support and the tight Maven/Spring/Struts integration.

One thing I haven't figured out, though:

In Eclipse (with Tomcat or Jetty) I can save a JSP template and hit the refresh button in the browser, and the IDE has silently recompiled and deployed a new JSP class, so the change is displayed immediately in the browser.
I haven't figured out how to enable this in IntelliJ. The best I have come up with:

1. Save the JSP template
2. Run -> Update "Tomcat6" application (Command + F10)
3. Refresh the page in the browser

The step I want to avoid is of course the second one. Not that big of a deal in itself, but if you have to do this "extra" step a hundred times a day, it starts to become annoying.

Cheers,
Kloper

1
7 comments
Avatar
Permanently deleted user

Actually you can avoid the first step. When you invoke 'Update' action IDEA automatically saves changed files.

Hi!

Thanks guys for a great product. I have recently switched from Eclipse 3.5 to IntelliJ IDEA 9.0.2 and I'm quite impressed, especially with the comprehensive syntax support and the tight Maven/Spring/Struts integration.

One thing I haven't figured out, though:

In Eclipse (with Tomcat or Jetty) I can save a JSP template and hit the refresh button in the browser, and the IDE has silently recompiled and deployed a new JSP class, so the change is displayed immediately in the browser.
I haven't figured out how to enable this in IntelliJ. The best I have come up with:

1. Save the JSP template
2. Run -> Update "Tomcat6" application (Command + F10)
3. Refresh the page in the browser

The step I want to avoid is of course the second one. Not that big of a deal in itself, but if you have to do this "extra" step a hundred times a day, it starts to become annoying.

Cheers,
Kloper

---
Original message URL: http://www.jetbrains.net/devnet/message/5257279#5257279



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

1

Hi, can you describe please how to set up this in IntelliJ 2019.1.3 (Ultimate Edition)?

1

more details:

# environment: Java app (Spring MVC + Maven + Git)

# background: in Eclipse, when I update *.jsp file and save it, after refreshing Chrome page, I can see changes I made

# problem: in IntelliJ I don't know how to implement the same workflow

 

# what I have already made: 

I tried to implement configuration to get the same workflow. I tried:

1) Live Edit plugin implementation

without succes:https://www.screencast.com/t/Hdi0F5bHF

2) changing compiler settings

3) unchecking safe write:

 

What should I do?

1
Avatar
Permanently deleted user

I knew this worked fine for Weblogic but I had never tested it with Tomcat so didn't want to respond that it works until I had tested it with Tomcat. I have now tested this with Tomcat and it works fine. I can just make changes to a JSP and then leave intelliJ, refresh my browser and it is there.

1) This only works when you are running with a Debug Configuration (i.e. start the Debugger, can't just Run the app).
2) Go to File->Settings->Compiler (under Project Settings), in the "Deploy web applications to serer after compilation" make sure "Never" is selected
3) Go to File->Settings->Debugger (under IDE Settings)->HotSwap, make sure Make project before reloading calsses and reload classes in background is selected. Also for Reload classes after compilation make sure "Always" is selected.
4) In your debugger configuration there is an option called "Build on frame deactivation", select that (it is not selected by default).

Now when you switch to your browser IntelliJ will be making (it saves before the make so no need to manually save) and copying out your changed JSP's (as well as hot swapping any changed classes).

If you still have problems just post back, there are a couple of other things I can have you check.

Screen shot 2010-02-25 at 10.21.51 AM.png
Screen shot 2010-02-25 at 10.22.17 AM.png
Screen shot 2010-02-25 at 10.22.50 AM.png

0

I had the same problem with JSP files not reloading using JBoss7.2 server locally in Intellij.

After much investigation I came across a fix, hope it helps someone else.

Undertow by default enables a file watcher to detect the JSP file change, which should then mark the file for recompiling.

In EAP 7.0.x, That file watcher can be disabled by setting the io.undertow.disable-file-system-watcher system property to true.

For example, add the following to $JBOSS_HOME/bin/standalone.conf:

JAVA_OPTS="$JAVA_OPTS -Dio.undertow.disable-file-system-watcher=true"

or add the system property in standalone.xml/domain.xml by executing the follwwing CLI:

 /system-property=io.undertow.disable-file-system-watcher:add(value=true)

If the file watcher is disabled, you can still enable recompilation in the undertow subsystem. Enable development mode for a recompilation check on every request:

<subsystem xmlns="urn:jboss:domain:undertow:3.1">
    ...
    <servlet-container name="default">
        <jsp-config development="true"/>
        <websockets/>
    </servlet-container>

That is not ideal for performance so for less overhead, set check-interval (in seconds) for how often JSPs should be checked for updates:

    <servlet-container name="default">
        <jsp-config check-interval="600"/>
        <websockets/>
    </servlet-container>

 

 

0

Please sign in to leave a comment.