Powered by Blogger.
Showing posts with label Jsp. Show all posts
Showing posts with label Jsp. Show all posts

Static ContextPath to Dynamic ContextPaths in Jsp and JS pages.

>> Thursday, January 26, 2012

Changing Static ContextPath to Dynamic ContextPath references in JSP and JS pages in our project. If you are working with any project on java and jsp technologies, if the requirement may come to change the static context paths to dynamic context path.

What is the need to change context path from static to dynamic context path?

While developing our application we use to develop to put our contextPath directly in some areas like for links and mostly for images we give absolute paths with context. We put this in developing the project. After developing the project , it goes to Testing after then to production.
Let us assume our project contextPath is "/myproj"

Read more..

JSP Tag Libraries in Breif

>> Sunday, October 30, 2011

You have many options when it comes to generating dynamic content inside the JSP page.

These options are as follows :
  • Scripting elements calling servlet code directly
  • Scripting elements calling servlet code indirectly (by means of utility     classes)
  • Beans
  • Servlet/JSP combo (MVC)
  • MVC with JSP expression language
  • Custom tags

Read more..

Using Debug Tag with an Example

>> Thursday, October 13, 2011


In this article we explained that to send the JSP content of the tag body to the client, one need only call the getJspBody().invoke(null) method inside the doTag method of the tag handler class.

This simplicity allows us to easily create tags that output their bodies conditionally. This functionality can be achieved by simply surrounding the getJspBody().invoke(null) invocation within an if statement.

In this section, we present an example of a custom tag that conditionally outputs its tag body. It's quite often the case when the output of the JSP page is something other than what you expected. In such a case, it's useful to have the option of seeing some debugging information right on the page without having to resort to embedding System.out.print statements throughout the page.

Read more..

Struts DispatchAction Example Application

>> Tuesday, June 21, 2011

Struts DispatchAction can group similar action classes into a single action class having different methods.
In this action excluding the execute method we can write our own user defined methods.The parameters are same given by struts framework (mapping,form,request,response).

In this example we will see how to group similar action methods in a single Class like add,sub,mul,div.In a single page we are performing four actions with different buttons.

In our example our Actionclass (CalculateAction) should extends DispatchAction to dispatch the action based on the parameter value of action button.Here we should concentrate how the action is performing.

Read more..

Upload CSV file into MySql Database based on columns using Servlets and Java

>> Tuesday, April 12, 2011

The CSV file is having multiple values to insert in perticular columns and rows in mysql database.

Here we have two files so we have to insert in two tables .

one is Header part file

another is Detail part file

Basically these two are to upload the questions and answers into the examination portal to upload question papers and answer paper in (Merit Tracking System project).

First we have to do the things are Uploaded file has to save in perticular folder and then they have to insert the values into the database table.This is our main task to do.

Read more..

JSP Implicit Objects

>> Wednesday, March 23, 2011

Actually Servlet don't have these implicit Objects After introducing of JSP it contains by default and with readymade Objects to use in our web applications.

These are available for programmer through Container. The implicit objects are parsed by the container and inserted into the generated servlet code. They are available only within the jspService method and not in any declaration. Implicit objects are used for different purposes. Our own methods (user defined methods) can't access them as they are local to the service method and are created at the conversion time of a jsp into a servlet.


These are 9 implicit Objects 

request
response
page
pageContext
application
exception
out  
config
session

Read more..

What are the JSP page attributes

>> Tuesday, March 22, 2011

Syntax of the declaration of the page directive with it's attributes is <%@ page attributeName="values" %>. The space between the tag <%@ and %> before the page(directive name) and after values of the last attribute, is optional, you can leave the space or not.


Following are name of the attributes of the page directive used in JSP:

JSP Page Directive Attributes


  • language
  • extends
  • import
  • session
  • buffer
  • autoflush
  • info
  • errorPage
  • isErrorPage
  • isThreadSafe

Read more..

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2022. All rights reserved.