Author Archives: Sreenivasa Majji

ATG Forms

ATG forms are similar to any typical form in web application and does the following: Validating user input Format of input Handle form errors Invoke Servlet / JSP Pass information to persistent storage Display nucleus properties in form elements Assigning … Continue reading

Posted in Uncategorized | Leave a comment

Default thread group

Every thread in Java has a thread group. The default thread group is ‘main’. Output of above code: ThreadGroup of main thread is: main If a thread ‘t’ is spawned from a main thread then the thread group of ‘t’ … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Commonly commands in Git

Here are some of the commonly used in Git: git status – displays modified files and staged files. git commit – commits all staged files to current remote branch git log – history of commits in the current branch git … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

3n+1 path

While reading Programming Challenges I thought of implementing the path of 3n+1 for a given number. Here is my first stab in Java. I am not trying to solve the problem, however I thought it is interesting to print the … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

Ant war task

Many of us build war files as part of the project, however some projects stilll use jar and copy ant tasks to assemble war file. However ant has a built-in war task which takes care of web.xml, classes, libraries etc., … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Validation and erroror reporting in Struts 1.1

One of the benefits of using Struts framework is declarative validation mechanism and error reporting. Struts provides validation hook so that you can implement your own validation logic in action classes. The validation can be turned on/off in action mapping … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

Internationalization in Struts 1.1

How do you internationalize your struts 1.1 application?  Here are simple steps: Prepare you language speicific resource bundles. Provide default resource bundle in struts-config.xml using message-resources Include struts bean tag lib in your web.xml using taglib In JSP,  include your … Continue reading

Posted in Uncategorized | Tagged , | 1 Comment

Implicit objects in JavaServer Pages.

In JSP you can get access to the following implicit objects: request – HttpServletRequest response  – HttpServletResponse Session – HttpSession out – JspWriter application – ServletContext config – ServletConfig pageContext page exception (available only to error pages).

Posted in Uncategorized | Tagged , , | 1 Comment

Scopes in JSP

In JSP you can create attributes in four scopes: page, request, session and application. If you need to access them Expression Language such as c:out tag, you can specify the scope explicitly. Here are some examples: <c:out value=”${pageScope.maxAttempts}” /> <c:out … Continue reading

Posted in Uncategorized | Tagged , | 1 Comment

ATG: How to pass parameters from JSP to Droplet

With tag , you can pass static value or object from JSP to droplet. Passing a constant: <dsp:param name=”maxProducts” value=”100″ /> You can retrieve the “maxProducts” parameter in the droplet by calling request.getParamter(“maxProducts”) which returns value of 100. Passing a … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment