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 226386 - Refresh browser on save does not work for JSPs
Summary: Refresh browser on save does not work for JSPs
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 7.4
Hardware: All All
: P2 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-20 10:45 UTC by Petr Jiricka
Modified: 2013-02-25 06:02 UTC (History)
2 users (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 Petr Jiricka 2013-02-20 10:45:29 UTC
1. Create a Java EE 6 project with index.jsp (I used Tomcat target to avoid any recent GlassFish-related regressions).
2. In project properties, switch browser to Chrome with NetBeans integration
3. Run the project, index.jsp will be opened in the browser
4. Modify and save index.jsp

=> Project will be redeployed, but browser will not be refreshed

At the same time, copy-resources-on-save works fine, because after refreshing the browser manually, the page is updated.

Also, analogous scenario in PHP project works fine.
Comment 1 David Konecny 2013-02-20 22:04:27 UTC
This does work for me if you run individual JSPs.

It does not work only on project execution when it is not clear which file was used to generate the browser content. Possible solution is to read web.xml and its <welcome-file-list> and use first available file which exists as a mapping for Refresh-On-Save. Failing that (eg. in case web.xml is missing) we could try few hardcoded options, eg. /index.jsp, /faces/index.xhtml, etc.

I think that Tomas was saying that in PHP in some cases he refreshes the browser after any save in IDE. That would be another option.
Comment 2 Petr Jiricka 2013-02-21 09:39:17 UTC
I agree reading web.xml and its <welcome-file-list> would be the right way to solve this. And if web.xml does not exist, I believe this case is specified in the servlet spec, so we should hardcode the list to match the servlet spec. This solution will also likely be needed to address the ServerURLMapping aspect of bug 226383.
Comment 3 David Konecny 2013-02-24 20:48:47 UTC
Resolved as part of the fix of issue 226383.
Comment 4 Tomas Mysik 2013-02-25 06:02:54 UTC
Just one note: In PHP, there is no web.xml or similar file so we refresh browser on every file save. This is perhaps the best possible solution.

Thanks.