facebook

quick jsp run/debug feature

  1. MyEclipse Archived
  2.  > 
  3. Old Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #196145 Reply

    Cao Xiaogang
    Member

    when I edit jsp file, from time to time, maybe after fix a small bug, I need to view the result. So, the best way is to bind a hotkey (maybe F12) to the editor window. and when you press F12, it will show the jsp in IE (better within Eclipse IDE).

    in the process, must do a local address and http url mapping.
    like \web app\test\test1.jsp <==> http://localhost:81/testProject/test/test1.jsp

    #196146 Reply

    No Operation
    Member

    since there is a small difference between JSP and HTML, that kind of preview would raise some questions:

    1. how woudl you hanlde embedded Java code <% … %>
    – there is no request, so all request parameters might not exist
    – there is no context, also session, application, page and request context might be invalid

    2. how would you handle expressions <%= %>
    – same questions as in 1.
    – this often affects attributes of html tags, how would you handle this?
    – there are also more complex variations possible, e.g
    <<%=tagname%> <%=attrname%>=<%=attrvalue%>>
    how would you display this, without having the values, which might depend on the work flow?

    NOP

    #196149 Reply

    Cao Xiaogang
    Member

    this kind of problem should be solved by program himself.
    I use JRun Studio for more than 3 years, and I love the feature very much, it’s really useful and reduce time.

    I just need a F12 hotkey to begin preview and run. Don’t worry about the session and workflow. If you provide the funtion, I am sure the programer will have his own way to use the function.

    Yes, the jsp run result depends on session and workflow.
    my work around is:
    in development stage, I will bypass the authticate or other session related check using the following code:

    // production stage
    // String userId = session.getAttribute(“sessionUser”);
    // debug stage
    String userId = “SomeOne”;

    It is dirty but it works.

    The Best solution is to let the IDE ‘remember’ request information for each page. programer can change the defult request values for a certain page.

    If the page belongs to a work flow, then no way to work around.

    Actually, Please don’t treat the feature as a very strick feature and don’t try to handle all the things that programer himself should handle.

    #196172 Reply

    No Operation
    Member

    Regarding some ‘typical’ development environment:

    – IDE (e.g. Eclipse)
    – Server (e.g. Tomcat)
    – Browser (e.g. Phoenix)

    where you just press STR+R in the browser to reload the page…
    … which advantage would you get with this feature?

    #196247 Reply

    Cao Xiaogang
    Member

    just a quick ‘show in Bowser’ will save user’s time to open a browser and type the address.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: quick jsp run/debug feature

You must be logged in to post in the forum log in