Skip to main content

my tailor uses Custom tag

Custom tags to avoid placing java code inside the JSP page "scripting", so that the JSP page is able to concentrate only on the presentation logic.

  • old "classic" where a developer has to adjust the flow, from start go to ?? , will evaluate the body or not, all done depending on the return value of overridden methods .
  • instance of tag handler is reused, can't rely on constructor to do initialization, better to use setPageContext( ).
  • now everything is done overriding just one method.
  • simple tag model never reuse tag handler instances.

body content:
  • in practice content is not processed at all
    • JspWriter out=getJspContext().getOut();
    • out.print(" ... ");
    • getJSPBody.invoke(null);
    • out.print(" ... ");
  • Modify to process body content
    • StringWriter writer=new StringWriter();
    • getJSPBody.invoke( writer );
    • String bodyContent=writer.toString();
.tld addresses to custom tag, so how to know about
  1. explicit "within web.xml"
  2. implicit "must contain the optional uri element"
    1. place the .tld in /WEB-INF or within one of its sub directory 
    2. use a packaged file, which is placed in /WEB-INF/lib
with Java-based tags tag handler is a java class, where as with Jsp based tags the tag handler is a Jsp page.

Comments

Popular posts from this blog

The post-office & the postman

If we were to talk about old messaging system where there exist post-office, postman & mailbox. each component had its own functionality that we looked for when trying to visualize how those component where to interact in a computerized version. Simple scenario: Mail is added in mail box Postman arrive pick mails from his area mailboxes and take them to the post-office. Post-office organize mails by areas. Postman takes mails related to his area "distribute it in mailboxes". A person can go to post-office and  pick his own mail "in case of failure or wishes for early delivery". Mapping in a computerized version: Scenario: Observer design pattern which can use push or pull scenario, to inform those whom are registered for an event about its occurrence. Component: Post-Office = Message-Broker Post-Office-Box = Message-Storage-Validity Mailbox = Topic/Queue Postman !!! where's the postman ? Apache kafka act as a message broker which d

Container Storage

When traveling, we always think of our traveling bag. How our luggage will fit in it, yet have you ever thought, How your bag will be stored or transferred. I think data should be thought of same way. How it will be stored and how it will be retrieved. also sizing would matter, How much size data will occupy. Would it fit in one server or will we need a cluster. Many question would jump in your mind, yet storing and retrieving is the most general one. And so we'll move to ask SQL or NoSQL, I'd go for SQL in-case of having multiple entities communicating with each other, having multiple relation between one another. Yet if what I need is a storage unit, then NoSQL would be my choice. Have a look on the CAP theorem and how each of consistency, availability and partition tolerance will be satisfied using the DB engine you choose

Big data OverView

Could you define Beauty ? So is Big Data, it is itself a definition. you could ask what is its characteristics. Big data has n Vs dimension, where n often changes. Laney (2001) suggested that Volume, Variety, and Velocity as 3 Vs, then IBM added Veracity "realism" as the fourth V, later Oracle introduced Value. So how would we process this Big Data. I use hadoop & wish to learn spark. Hadoop is an opensource framework used for analyzing big chunk of data, its divide to 2 modules. map-reduce module and a file system module "HDFS". hadoop divide data to small chunk, start processing each chunk on its own, then start combining each chunk again "divide and conquer principle we used to do in merge sort", each chunk need a core & memory to run on. as a start I need to define location of my data, where would my data reside data would reside hadoop file system (HDFS) fs.defaultFS : hdfs://rserver:9000/ then I define my resources " number o