Archive for the ‘ Programming ’ Category

Multi-Threaded Servlet

When you serve servlet, you would end up having to make your own servlet multi-threaded. How? Simply implement SingleThreadModel to your class.

What that does is that it will let first request from a user finish and the seond request wait for the first to finish. How cool is that! However, note that this interface is there when you need to access to external resources such as a text file.

precedure of servlet & best practice

Sometimes you would need to summarize knowledge that you’ve leant in order to organize it in your brain. That’s why it’s a good idea to write it down so that you know that you organized knowledge you earned.

Anyways, lately I’ve been studying JavaServlet and have to because web content management system has been implemented in my client’s company and this giant web content management called “Documentum” utilizes most technologies given ever such as .Net and Java. I’ve decided to use Java Servlet and JSP to learn some business logic aspect in development.

In servlet class the precedure is as following:
1. Once servlet class is instantiated init method is called and its signature is as following:

public void init(ServletConfig config) throws ServletException

2. After servlet’s init method, service method is called by the servlet container. It has following signature:

public void service(ServletRequest request, ServletResponse response) throws ServletException, java.io.IOException

And then the best practice to deploy dynamic web pages seems to be Servlet-Beans-JSP combination.

I can set up servlet to do the database work and put the results into beans. And the JSP gets the beans from the servlet and displays it as HTML. How does it sound like? I just got to know about it today.

So many things to learn in java… sigh :^@

xslt, xml, xpath

http://www.helpqlodhelp.com/blog/archives/000094.html

I took a look at the above link and thought I’d like to share what I’m doing at work with you.
Most of time my job is related to xml and xslt. Using those two monsters, manage content easily and make it portable so that the look of the site can be interchangable.

As long as you keep your content data either in relational database or xml database in oracle 9i, all you have to do in order to show client users is to prepare xslt stylesheet. With xml formatted data you can utilize it with any other technoloies and this is when XML kicks ass.

As of now, xpath version 1 is used. Meaning that with it you may end up with using javaScript to solve some scripting issues. That’s because xpath version 1 doesn’t offer much functionalities.

With understanding of XML and XSLT, you will look at the web site from totaly different perspective than you had before.

Maybe I’ll change my blog to my own blogging system utilizing xml and xslt someday. Also I’ll upload some tutorials someday too.

RegExLib.com

http://www.regxlib.com/Default.aspx

The above link leads to a site where there are 449 expressions from developers around the world. If you may need something very quick, why don’t you look for pre-built expression from the site above? ;)

via Digital Media Minute

Proce55ing..