Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRAILS-5051: JSP files do not refresh in the application when changed #4684

Closed
graemerocher opened this issue Aug 31, 2009 · 1 comment
Closed

Comments

@graemerocher
Copy link
Member

Original Reporter: jdigweed
Environment: Linux 2.6 (Ubuntu 9.0.4) Sun JDK 1.6.0_16
Version: 1.1.1
Migrated From: http://jira.grails.org/browse/GRAILS-5051

GSP behavior (desirable)

  1. grails create-app refresh
  2. grails create-controller basic
  3. grails run-app
  4. Go to http://localhost:8080/refresh/basic/index. Get a 404.
  5. Add a new file: grails-app/views/basic/index.gsp. Just put something simple in it, like html-body-hello world-/body-/html.
  6. Refresh the browser. See that hello world appears.
  7. Edit index.gsp to add "hello again"
  8. Refresh browser. Hello again will appear.

JSP behavior (not desirable)

  1. grails create-app refresh
  2. grails create-controller basic
  3. grails run-app
  4. Go to http://localhost:8080/refresh/basic/index. Get a 404.
  5. Add a new file: grails-app/views/basic/index.jsp (note the J, not a G). Just put something simple in it, like html-body-hello world-/body-/html.
  6. Refresh your browser. The file will not appear.
  7. Kill the run app (control-C) and re-run it (grails run-app).
  8. Refresh your browser (http://localhost:8080/refresh/basic/index). Hello world now appears.
  9. Edit grails-app/views/basic/index.jsp. Add AGAIN to the text.
  10. Refresh your browser. Note that the again does not appear.

Now, going from GSP editing to JSP editing, this could be confusing, as a developer may reasonably be expecting that the JSP files would be treated the same way as the GSP files.

The root cause, as I understand it, is that the JSP's are copied at run-app time to WEB-INF/views and they are not updated after that even if they change. So there are two possible solutions I could think of:

  • Somehow make it resolve the files in their original places under grails-app instead of looking in WEB-INF.
  • Somehow monitor for new files (like how it monitors for new domain classes, for instance) and copy over the new files into WEB-INF/views as necessary. This may involve editing RunApp.groovy (and/or the scripts it uses).

I'm not sure which of those is better. I'm leaning towards #2 and going to try to come up with a patch.

@graemerocher
Copy link
Member Author

aswin said:
fuck u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant