This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What happens at translation?

 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

What steps are taken at jsp page translation? Does compilation comes under
this or there is separate life cycle for this?

I get the following in the Specification:


...
During the translation phase the container locates or creates the JSP page
implementation class that corresponds to a given JSP page. This process is
determined by the semantics of the JSP page. ...


I miss to understand what does this mean to locate or create the JSP
page implementation class ...

Please help me!

Thanks,
 
Arnab Sinha
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most of the time even though a jsp deployed as a part of web application, the container has not generated the servlet java file, and compiled it to its class file. By default it waits for the first client request.

Thats why, it says, the container first locates the jsp resource. Once located it generates the servlet-java file, compiles it. If all goes well, it will create an instance, assign a thread, and pass the request response objects to it.

However, you can change that setting in the DD, where you can specify that you want the jsp to be compiled and ready when deployed. But its not a good design practice for all jsps.

Does this make sense?
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah Arnab,

That is really very nice.
What about other things that happen when translation takes place as
validating tag libraries, checking semantics.



Thanks,
 
Vilas Lawande
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
During tanslation

Assume jsp file name is Demo.jsp

1> Demo.jsp file is converted into Demo_jsp.java
2> Demo_jsp.java is complied into Demo_jsp.class

This total translation is did by container
later on it will work like simple servlet
 
khushhal yadav
Ranch Hand
Posts: 242
Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about other things that happen when translation takes place as
validating tag libraries, checking semantics.


Verification occurs for:
  • The attribute-value pairs in the directives abd standard actions are valid.

  • Whether custom tag libraries are valid.
    Usage of custom tags are valid
    The same JavaBean name is not used for more than once in a single translation unit.


    Regards,
    Khushhal
     
    Joe Harry
    Ranch Hand
    Posts: 10128
    3
    Eclipse IDE Mac PPC Ubuntu
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    All jsp related syntax is verified during translation time along with the translation of the jsp file to a servlet .java file.
    [ August 17, 2007: Message edited by: Jothi Shankar Kumar Sankararaj ]
     
    naresh govindaswmay
    Ranch Hand
    Posts: 90
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    hi
    First i will check all syntax according to the specification. Then it will generate the servlet file to process the request and response
     
    Raghavan Muthu
    Ranch Hand
    Posts: 3381
    Mac MySQL Database Tomcat Server
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Chandra Bhatt:What about other things that happen when translation takes place as
    validating tag libraries, checking semantics.



    Chandra,

    I am sure that they are *also* a part of translation phase and that's when you get an error when you request for a jsp page with some syntax errors on taglib etc.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic