Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!

Anu katoch

Greenhorn
+ Follow
since Jan 16, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anu katoch

My absolute path for tomcat is C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\Store\UserInput.jsp

where store is my application which is deployed in tomcat webapps directory so i have changed my path as response.sendRedirect("/Store/UserInput.jsp");

now it is giving me error HTTP Status 404 -Store/Store/UserInput.jsp Resource Not Found and URL it is forming http://localhost:8080/Store/Store/UserInput.jsp.
6 years ago
Hello
I am getting error HTTP Status 404


when I am sending respose as response.sendRedirect("/UserInput.jsp);

UserClass.java



Serlvet Controller.java



Web.XML



Please help me for the same Thanks in advance
6 years ago
Hi

After removing response.sendRedirect("/UserInput.jsp");from viewUser() method my Servlet's doget method is getting excuting again and again in continues loop and brower is showing Login window in waiting state and i have removed <jsp:include page="/Login.jsp" flush="true" ></jsp:include> from UserInput .

Please help! Thanks in Advance
6 years ago
Hi Prasad;

when i am removing response.sendRedirect("/UserInput.jsp");from viewUser() method then my doget method is executing again and again in loop which is never ending loop and browser only have Login Page display.

Thanks and Looking for your response for the same.

6 years ago
Sorry i have removed line number 37 which was unused PrintWriter Object but still have same issue.
6 years ago
This is login.jsp through with i am sending the request


This is UserInput.jsp to which i am forwarding the request

This is UserClass.java which is Invoked through reflection and method viewUser


Please Help Thanks in advance.
6 years ago
I have removed finally block which used for closing .out object. But didn't help much . Still problem persist


exception i am facing

6 years ago
Still facing exception
ava.lang.IllegalStateException: Cannot forward after response has been committed
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:349)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at servlets.Controller.doGet(Controller.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

after removing return statements after foward

package servlets;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.RequestDispatcher;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;





import Beans.Registry;


/**
* Servlet implementation class Controller
*/
@WebServlet("/Controller" )
public class Controller extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
private static final long serialVersionUID = 1L;

/**
* @see HttpServlet#HttpServlet()
*/
public Controller() {
// super();
// TODO Auto-generated constructor stub
}



protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.setContentType("text/html;charset=UTF-8");
PrintWriter out=response.getWriter();

String services = request.getParameter("Services");
String username = request.getParameter("UserName");
String password = request.getParameter("Password");
System.out.println("username>>>>>>>>>>>>>>>>>>>>>>"+username);
System.out.println("Services>>>>>>>>>>>>>>>>>>>>>>"+services);
System.out.println("Password>>>>>>>>>>>>>>>>>>>>>>"+password);
System.out.println("Requested Services:"+services);
Registry reg = new Registry();

//String user =(String)request.getSession().getAttribute("UserName");

request.getSession().setAttribute("UserName", username);
request.setAttribute("Password", password);


if(username==null&&(services==null|| (!services.equals("login")))){
String err ="Unauthorized Access";
request.setAttribute("errormsg", err);
RequestDispatcher disp =this.getServletContext().getRequestDispatcher("/error.jsp");
disp.forward(request, response);



}else{
try{
if(!reg.find(services)){
String err ="Unreconized Services";
request.setAttribute("errormsg", err);
RequestDispatcher disp = this.getServletContext().getRequestDispatcher("/error.jsp");
disp.forward(request,response);



}else{
System.out.println("Service Class:"+reg.getsClass());
String cl="Beans."+reg.getsClass();
Class cls = Class.forName(cl);
Object obj = cls.newInstance();
Method mth = cls.getMethod(reg.getsMethod(), HttpServletRequest.class,HttpServletResponse.class);
String redirectPage = (String)mth.invoke(obj, request,response);
System.out.println("Return Page:"+redirectPage);

RequestDispatcher disp =this.getServletContext().getRequestDispatcher(redirectPage);
disp.forward(request, response);
execption occur at this point only



}

}catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
finally{
out.close();

}
}

}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}



}

Need help on this.. Problem Still persist, Please help.

6 years ago
Hey I am new to Jsp/Servlets i am getting following Exception
java.lang.IllegalStateException: Cannot forward after response has been committed
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:349)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at servlets.Controller.doGet(Controller.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

and my Servlet Code is

package servlets;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.RequestDispatcher;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;





import Beans.Registry;


/**
* Servlet implementation class Controller
*/
@WebServlet("/Controller" )
public class Controller extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
private static final long serialVersionUID = 1L;

/**
* @see HttpServlet#HttpServlet()
*/
public Controller() {
// super();
// TODO Auto-generated constructor stub
}



protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.setContentType("text/html;charset=UTF-8");
PrintWriter out=response.getWriter();

String services = request.getParameter("Services");
String username = request.getParameter("UserName");
String password = request.getParameter("Password");
System.out.println("username>>>>>>>>>>>>>>>>>>>>>>"+username);
System.out.println("Services>>>>>>>>>>>>>>>>>>>>>>"+services);
System.out.println("Password>>>>>>>>>>>>>>>>>>>>>>"+password);
System.out.println("Requested Services:"+services);
Registry reg = new Registry();

//String user =(String)request.getSession().getAttribute("UserName");

request.getSession().setAttribute("UserName", username);
request.setAttribute("Password", password);


if(username==null&&(services==null|| (!services.equals("login")))){
String err ="Unauthorized Access";
request.setAttribute("errormsg", err);
RequestDispatcher disp =getServletContext().getRequestDispatcher("/error.jsp");
disp.forward(request, response);
return;


}else{
try{
if(!reg.find(services)){
String err ="Unreconized Services";
request.setAttribute("errormsg", err);
RequestDispatcher disp = getServletContext().getRequestDispatcher("/error.jsp");
disp.forward(request,response);
return;


}else{
System.out.println("Service Class:"+reg.getsClass());
String cl="Beans."+reg.getsClass();
Class cls = Class.forName(cl);
Object obj = cls.newInstance();
Method mth = cls.getMethod(reg.getsMethod(), HttpServletRequest.class,HttpServletResponse.class);
String redirectPage = (String)mth.invoke(obj, request,response);
System.out.println("Return Page:"+redirectPage);

RequestDispatcher disp =getServletContext().getRequestDispatcher(redirectPage);
disp.forward(request, response);
//on this foward request i am getting the above exception;
return;

}

}catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
finally{
out.close();

}
}

}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}

It is properly excuting viewUser method
the following code
/**
*
*/
package Beans;

import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletConfig;
import javax.servlet.RequestDispatcher;
import javax.xml.ws.Response;

import org.apache.catalina.connector.Request;

import connection.Database;

/**
*
*
*/
public class UserClass {

private Number User_ID;
private String User_Name;
private String Password;
private String User_Type;



public Number getUser_ID() {
return User_ID;
}
public void setUser_ID(Number user_ID) {
User_ID = user_ID;
}
public String getUser_Name() {
return User_Name;
}
public void setUser_Name(String user_Name) {
User_Name = user_Name;
}
public String getPassword() {
return Password;
}
public void setPassword(String password) {
Password = password;
}
public String getUser_Type() {
return User_Type;
}
public void setUser_Type(String user_Type) {
User_Type = user_Type;
}


public String viewUser(HttpServletRequest request, HttpServletResponse response)throws SQLException
{
String query="SELECT User_Name,Password FROM User";
Database cn= new Database();
cn.loadDriver();
cn.connect();

boolean chk =false;

String currentuser =(String) request.getSession().getAttribute("UserName");
String currentpassword = request.getParameter("Password");
String resultsetUser = null;
String resultsetPassword = null;
String redirectresponse = null;


ResultSet resultset = cn.result(query);
while(resultset.next()){
resultsetUser = resultset.getString("User_Name");
resultsetPassword = resultset.getString("Password");
resultset.close();
cn.disconnect();
if(currentuser.equals(resultsetUser) && currentpassword.equals(resultsetPassword)){

redirectresponse="/UserInput.jsp";

try {
response.sendRedirect("/UserInput.jsp");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
break;

}else{
System.out.println("Invalid username and password");
redirectresponse="/error.jsp";

try {
response.sendRedirect("/error.jsp");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
}
return redirectresponse;





}


}




}

Thanks for your help in Advance




6 years ago
Hi,
i am trying to integrate RMI with web application at client site .My classes are complied in jdk1.6.0_11
and my application version is using jdk1.5.0_11 and using jboss as web server
that is the reason it is not supporting my classes and packages .

My single class with complete functionality on same system is working but for that also i have to complie the class jdk1.5.0_11
can you please guide me how can i move forward.
My single class with complete functionality on same system is working but for that also i have to complie the class jdk1.5.0_11
My classes are complied in jdk1.6.0_11
and my application version is using jdk1.5.0_11 and using jboss as web server
that is the reason it is not supporting my classes and packages
can you please guide me how can i move forward
<%@
page language="java"
import="org.pentaho.core.system.PentahoSystem,
org.pentaho.core.session.IPentahoSession,
org.pentaho.core.util.XmlHelper,
org.pentaho.messages.Messages,

org.pentaho.core.util.UIUtil,
org.pentaho.core.util.IUITemplater,
org.pentaho.messages.util.LocaleHelper,
org.pentaho.util.VersionHelper,
org.pentaho.ui.component.INavigationComponent,
org.pentaho.ui.component.NavigationComponentFactory,
org.pentaho.ui.component.HtmlComponent,
org.pentaho.core.ui.SimpleUrlFactory,
org.pentaho.core.solution.SimpleParameterProvider,
org.pentaho.ui.ChartHelper,
org.dom4j.*,
org.pentaho.core.solution.ActionResource,
org.pentaho.core.solution.IActionResource,
ADD.java.Clt,
java.io.*,
java.util.*,
java.text.*"
%><%

/*
* Copyright 2006 Pentaho Corporation. All rights reserved.
* This software was developed by Pentaho Corporation and is provided under the terms
* of the Mozilla Public License, Version 1.1, or any later version. You may not use
* this file except in compliance with the license. If you need a copy of the license,
* please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
* BI Platform. The Initial Developer is Pentaho Corporation.
*
* Software distributed under the Mozilla Public License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
* the license for the specific language governing your rights and limitations.
*
* @created Jul 23, 2005
* @author James Dixon
*
*/

response.setCharacterEncoding(LocaleHelper.getSystemEncoding());
String baseUrl = PentahoSystem.getApplicationContext().getBaseUrl();
String path = request.getContextPath();
IPentahoSession userSession = UIUtil.getPentahoSession( request );

String intro = "";
String footer = "";
IUITemplater templater = PentahoSystem.getUITemplater( userSession );
if( templater != null )
{
String sections[] = templater.breakTemplate( "template-home.html", "", userSession ); //$NON-NLS-1$ //$NON-NLS-2$
if( sections != null && sections.length > 0 )
{
intro = sections[0];
}
if( sections != null && sections.length > 1 )
{
footer = sections[1];
}
} else {
intro = Messages.getString( "UI.ERROR_0002_BAD_TEMPLATE_OBJECT" );
}

intro = intro.replaceFirst( "\\{welcome\\}", Messages.getString("UI.USER_WELCOME") ); //$NON-NLS-1$
%>

<%= intro %>
<p><font name=verdana color=RED size="2"><B>
<%
int Exist_stateV = 0;
int Exist_stateL = 0;
int Exist_stateB = 0;

int EXENotExists=0;
int count=0;
int Valuecnt=0;

Map map = System.getenv();
Set keys = map.keySet();
Iterator iterator = keys.iterator();
String key =null;
String value = null;
out.println("<br>");
out.println("<div align=center>");

while (iterator.hasNext())
{
key = (String) iterator.next();
if (key.toLowerCase().equals("bicpath"))
{
count=count+1;
value = (String) map.get(key);
break;
}
}

if (count == 1)
{
if (value == null)
{ Valuecnt=0;
//out.println("<marquee WIDTH=30% SCROLLDELAY=10 DIRECTION=LEFT Height=20>");
out.println("Error System Environment Variable BICPATH VALUE IS NULL");
//out.println("</marquee>");
//out.println("<br>");
}
if (value.length() == 0)
{ Valuecnt=0;
//out.println("<marquee WIDTH=30% SCROLLDELAY=10 DIRECTION=LEFT Height=20>");
out.println("Error System Environment Variable BICPATH VALUE NOT PRESENT");
//out.println("</marquee>");
//out.println("<br>");

}
boolean exists = (new File(value)).exists();
if (exists)
{ //out.println("<marquee WIDTH=30% SCROLLDELAY=10 DIRECTION=LEFT Height=20>");
// out.println("Error System Environment Variable BICPATH VALUE Dir Exists");
//out.println("</marquee>");
Valuecnt=1;
}
else

{ //out.println("Does not Exists");
Valuecnt=0;
}
}
if (count==0)
{ //out.println("<marquee WIDTH=30% SCROLLDELAY=10 DIRECTION=LEFT Height=20>");
out.println("Error System Environment Variable BICPATH Not Found");
//out.println("</marquee>");
out.println("<br>");
}
if (Valuecnt==0)
{ //out.println("<marquee WIDTH=30% SCROLLDELAY=10 DIRECTION=LEFT Height=20>");
out.println("Error System Environment Variable BICPATH [ "+value+" ] Directory Doesn't Exist");
//out.println("</marquee>");
out.println("<br>");
}
out.println("</B>");
if (count==1)
{
if (Valuecnt==1)
{
File EXEfile = new File(value +"\\DexT.exe");
if (EXEfile.exists())
{
EXENotExists=1;
}
}
}
//File file=new File("F:\\TallyBIC\\Transformations\\Export\\MergedVouchers.txt");
File file = new File(value +"\\Export\\MergedVouchers.txt");
long modifiedtime= file.lastModified();
Date dm=new Date(modifiedtime);
if(file.exists())
{
Exist_stateV = 1;
//-- out.println("<br>");
out.println("<div align=center>");
// out.println("The Data For Vouchers was Last Refreshed on [ " +dm+" ]");
}
else
{
Exist_stateV = 0;
//out.println(" The Data For Vouchers Does not Exist at [ " +file+" ]");
}
File fileL=new File(value +"\\Export\\MergedLedgers.txt");
long modifiedtimeL= fileL.lastModified();
Date dmL=new Date(modifiedtimeL);
if(fileL.exists())
{
Exist_stateL = 1;
// out.println(" The Data For Ledgers was Last Refreshed on [ " +dmL+" ]");
}
else
{
Exist_stateL = 0;
//out.println(" The Data For Ledgers Does not Exist at [ " +fileL+" ]");
}

File fileB=new File(value +"\\Export\\MergedBills.txt");
long modifiedtimeB= fileB.lastModified();
Date dmB=new Date(modifiedtimeB);
if(fileB.exists())
{
Exist_stateB = 1;
// out.println("<br>");
// out.println(" The Data For Bills was Last Refreshed on [ " +dmB+" ]");
}
else
{ Exist_stateB = 0;
// out.println("<br>");
// out.println(" The Data For Bills Does not Exist at [ " +fileB+" ]");
}
if (Exist_stateV == 1 && Exist_stateL == 1 && Exist_stateB == 1)
{ //out.println("<br>");
// out.println("<B>");
// out.println("<div align=Left>");
//out.println("<marquee WIDTH=30% SCROLLDELAY=10 DIRECTION=LEFT Height=20>");

// out.println(" The Data was Last Refreshed on [ " +dmB+" ]");
//out.println("</marquee>");
//out.println("</B>");
//-- out.println("<br>");
}
else
{ out.println("<B>");
//out.println("<marquee WIDTH=30% SCROLLDELAY=10 DIRECTION=LEFT Height=20>");
out.println("<div align=Left>");
//-- out.println("Error Status:-Files Do not Exist at " + value + "\\Export Directory");
//out.println("</marquee>");
out.println("</B>");
//-- out.println("<br>");
if(Exist_stateV == 0)
{
// out.println("<br>");
out.println("<div align=Left>");
//out.println("<marquee WIDTH=20% SCROLLDELAY=175 DIRECTION=LEFT BGCOLOR=RED>");
//-- out.println(" The Data For Vouchers Does not Exist at [ " +file+" ]");
//out.println("</marquee>");
}
if(Exist_stateL == 0)
{
//-- out.println("<br>");
out.println("<div align=Left>");
//--- out.println(" The Data For Ledgers Does not Exist at [ " +fileL+" ]");
}
if(Exist_stateB == 0)
{
// out.println("<br>");
out.println("<div align=Left>");
//--- out.println(" The Data For Bills Does not Exist at [ " +fileB+" ]");
}
}
File Histfile = new File(value +"\\Export\\CurrentYr\\ALLCompanies_MergedHCVch.txt");
long Histmodifiedtime= Histfile.lastModified();
Date Histdm=new Date(Histmodifiedtime);

File HistfileL = new File(value +"\\Export\\CurrentYr\\ALLCompanies_MergedHCLed.txt");
long HistmodifiedtimeL= HistfileL.lastModified();
Date HistdmL=new Date(HistmodifiedtimeL);

File HistfileB = new File(value +"\\Export\\CurrentYr\\ALLCompanies_MergedHCStocks.txt");
long HistmodifiedtimeB= HistfileB.lastModified();
Date HistdmB=new Date(HistmodifiedtimeB);

int HExist_stateV = 0;
int HExist_stateL = 0;
int HExist_stateB = 0;

if(Histfile.exists())
{
HExist_stateV = 1;
}
else
{
HExist_stateV = 0;
}
if(HistfileL.exists())
{
HExist_stateL = 1;
}
else
{
HExist_stateL = 0;
}
if(HistfileB.exists())
{
HExist_stateB = 1;
}
else
{
HExist_stateB = 0;
}



if (HExist_stateV == 1 && HExist_stateL == 1 && HExist_stateB == 1)
{ out.println("<br>");
out.println("<div align=Left>");
out.println("<B>");
//out.println("<marquee WIDTH=30% SCROLLDELAY=10 DIRECTION=LEFT Height=20>");
out.println(" The Data was Last Refreshed on [ " +HistdmB+" ]");
//out.println("</marquee>");
out.println("</B>");
out.println("<br>");
}
else
{
out.println("<B>");
out.println("<div align=Left>");
//out.println("<marquee WIDTH=30% SCROLLDELAY=10 DIRECTION=LEFT Height=20>");
out.println("Error Status:- No Data available at " + value + "\\Export\\CurrentYr Directory");
out.println("<br>");
out.println("Click Refresh Data Button To run EXE ");
//out.println("</marquee>");
out.println("</B>");
// out.println("<br>");
if(HExist_stateV == 0)
{
// out.println("<br>");
out.println("<div align=Left>");
//out.println("<marquee WIDTH=20% SCROLLDELAY=175 DIRECTION=LEFT BGCOLOR=RED>");
//-- out.println(" The History Data For Vouchers Does not Exist at [ " +Histfile+" ]");
//out.println("</marquee>");
}
if(HExist_stateL == 0)
{
//out.println("<br>");
out.println("<div align=Left>");
//--out.println(" The History Data For Ledgers Does not Exist at [ " +HistfileL+" ]");
}
if(HExist_stateB == 0)
{
//out.println("<br>");
out.println("<div align=Left>");
//--out.println(" The History Data For Bills Does not Exist at [ " +HistfileB+" ]");
}
}
%>
</font>
</p>
<FORM NAME="form1" METHOD="POST">
<div align="center">
<p><font color=#8000 size="2">
<br/>
Click "Refresh Data" Button For Live Data</font>
<input type="hidden" name="username" value="aa" size="3"></p>
<p><input type="submit" value="Refresh Data" name="B1"></p>
</FORM>

<%
// See if we have a 'territory' parameter
String territory = request.getParameter("territory");
// See if we have a 'productline' parameter
String productline = request.getParameter("productline");

// Create the title for the top of the page
String title = "Top Ten Customers";
if( territory == null && productline != null) {
title = "Top Ten for " + productline;
}
else if ( territory != null && productline == null) {
title = "Top Ten for " + territory;
}
else if ( territory == null && productline == null) {
title = "Top Ten Customers";
}
else {
title = "Top Ten for " + territory + ", " + productline;
}

String pie1 = "";
String pie2 = "";
String chart = "";

SimpleParameterProvider parameters = new SimpleParameterProvider();
parameters.setParameter( "drill-url", "Home?territory={territory}" );
parameters.setParameter( "inner-param", "territory"); //$NON-NLS-1$ //$NON-NLS-2$
parameters.setParameter( "image-width", "375"); //$NON-NLS-1$ //$NON-NLS-2$
parameters.setParameter( "image-height", "275"); //$NON-NLS-1$ //$NON-NLS-2$
StringBuffer content = new StringBuffer();
ArrayList messages = new ArrayList();
ChartHelper.doPieChart( "samples", "steel-wheels/homeDashboard", "territory.widget.xml", parameters, content, userSession, messages, null );

pie1 = content.toString();

parameters = new SimpleParameterProvider();

if( territory == null ) {
parameters.setParameter( "drill-url", "Home?productline={productline}" );
} else {
parameters.setParameter( "drill-url", "Home?territory="+territory+"&productline={productline}" );
}

parameters.setParameter( "territory", territory );
parameters.setParameter( "productline", productline );
parameters.setParameter( "inner-param", "territory"); //$NON-NLS-1$ //$NON-NLS-2$
parameters.setParameter( "inner-param", "productline"); //$NON-NLS-1$ //$NON-NLS-2$
parameters.setParameter( "image-width", "375"); //$NON-NLS-1$ //$NON-NLS-2$
parameters.setParameter( "image-height", "275"); //$NON-NLS-1$ //$NON-NLS-2$
content = new StringBuffer();
messages = new ArrayList();
ChartHelper.doPieChart( "samples", "steel-wheels/homeDashboard", "productline.widget.xml", parameters, content, userSession, messages, null );
pie2 = content.toString();

parameters = new SimpleParameterProvider();
parameters.setParameter( "image-width", "500"); //$NON-NLS-1$ //$NON-NLS-2$
parameters.setParameter( "image-height", "525"); //$NON-NLS-1$ //$NON-NLS-2$
parameters.setParameter( "territory", territory );
parameters.setParameter( "productline", productline );
parameters.setParameter( "inner-param", "territory"); //$NON-NLS-1$ //$NON-NLS-2$
parameters.setParameter( "inner-param", "productline"); //$NON-NLS-1$ //$NON-NLS-2$

content = new StringBuffer();
messages = new ArrayList();
ChartHelper.doChart( "samples/steel-wheels", "homeDashboard", "customer.widget.xml", parameters, content, userSession, messages, null );
chart = content.toString();

%>

<center>
<table style="width:1000" border="0">
<tr>
<!-- td>
<span class="welcome_message"><%= Messages.getString("UI.USER_WELCOME") %></span>
</td> -->
<td colspan='2' class='content_pagehead'>
<%//= Messages.getString( "UI.USER_HOME_INTRO" ) %>
</td>
</tr>
</table>

<table style="text-align: left; border:1px solid #808080" cellpadding="0" cellspacing="0" border="0" >
<tr>
<td valign="top" align="center"><%= pie1 %></td>
<td rowspan="2" valign="top">
<%= title %>
<%= chart %>
</td>
</tr>
<tr>

<td valign="top" align="center">
<%= pie2 %>
</td>
</tr>
</table>

<table width="1000" style="padding: 5px 5px 5px 5px">
<!--
<tr>
<td width="500" class="content_header"><%= Messages.getString( "UI.USER_LINKS" ) %></td>
<td width="500" class="content_header"><%= Messages.getString( "UI.USER_WHATS_NEW") %></td>
</tr>
-->

<!-- <tr>
<td valign="top" class="content_container3" style="text-align:left"> -->

<%
messages = new ArrayList();
HtmlComponent html = new HtmlComponent( HtmlComponent.TYPE_URL, "http://www.pentaho.org/demo/links.htm", Messages.getString("UI.USER_OFFLINE"), null, messages);
html.validate( userSession, null );

%>
<%//= html.getContent( "text/html" ) %>
<!-- </td>
<td valign="top" class="content_container3" style="text-align:left"> -->

<%
messages = new ArrayList();
//html = new HtmlComponent( HtmlComponent.TYPE_URL, "http://www.pentaho.org/demo/news1.htm", Messages.getString("UI.USER_OFFLINE"), null, messages);
//html.validate( userSession, null );

%>

<% ADD.java.Clt dext = new ADD.java.Clt();%>
<%! private String accessCount=null; %>
<%! private String Initial=null; %>
<%! private String Count=new String("aa"); %>
<%! private int Error_Status=0; %>
<%! private int ES; %>

<p><font name=verdana color=white size="2"><B>
<%= accessCount=request.getParameter("username") %>
</p>
<% if(accessCount!=null) { %>

<%=accessCount=request.getParameter("Initial")%>
<% Error_Status=dext.sum();
System.out.print(Error_Status);
if (EXENotExists==0)
{
%>
<script type="text/javascript">
alert("DexT.exe does not Exist ");
</script>
<%
}
%>

<%
if (Valuecnt!=0 && EXENotExists==1)
{

%>
<script type="text/javascript">
alert("Data Extraction Process Completed");
</script>
<%
}
%>
<% } else {

ES=0;
%>
<script type="text/javascript">
<!-- alert(" Click (Refresh Data) Button For Live Data"); -->
</script>
<%
}
%>
<%//=html.getContent( "text/html" ) %>
<!-- </td>
</tr> -->
</table>
</center>

<%= footer %>

yes i have done that..
i am using pantaho that has configured jboss server and it is BIapplication and on home page of that there is button which excute sum function at remote location and returning that to home.jsp