Sudheesh

Greenhorn
+ Follow
since Sep 22, 2005
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 Sudheesh

Hi Aaron,

Thanks for your reply, In which context you got this err? I mean How did you get this err? Is it because i am hard coded the userid and passwd to the html tag fields?
I don't think that there is any problem with struts-config file.
Please help...

Regards,
Sudheesh...
15 years ago
Hello sir,

As you have asked, i am posting the JSP page here,

I am sorry i am not able to post the full html code here because it shows the "<" and ">" symbols are not allowed. I tried with & lt; but no use found...So kindly adjust

%@ taglib uri="/WEB-INF/struts/struts-html.tld" prefix="html"
%@ taglib uri="/WEB-INF/struts/struts-bean.tld" prefix="bean"
%@ taglib uri="/WEB-INF/struts/struts-logic.tld" prefix="logic"

html:form action="/Login.myatlas" focus="userid"
table border="0"
tr BR
td bean:message key="login.label.userid"/
/td
td html:text property="userid" size="20" maxlength="20" value="admin"/ /td
/tr
tr
td bean:message key="login.label.password"/
/td
td html assword property="password" size="20" maxlength="20" redisplay="false" value="atlasadmin"/ /td
/tr
/table


/html:form With best regards,
Sudheesh K S
15 years ago
Hi,
I have created a struts aplication and deployed it to JBOSS. Initially it was working fine. But when i redeployed the same application, I am getting an error as given below,

exception

org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.lang.NullPointerException
org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java:1161)
org.apache.struts.taglib.TagUtils.message(TagUtils.java:1024)
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:224)
org.apache.jsp.pages.allfiresupportunits_jsp._jspx_meth_bean_message_0(org.apache.jsp.pages.allfiresupportunits_jsp:729)
org.apache.jsp.pages.allfiresupportunits_jsp._jspx_meth_html_html_0(org.apache.jsp.pages.allfiresupportunits_jsp:98)

I tried to rdeploy it agai by restarting the sevrer, but got the same result...
What could be the possible reasons for this error?
Please help me to solve this problem...

Sudheesh K S
15 years ago
Sirs,
Thank you very much for your replies. Infact I am planning to call a validation function to check the file extension using Java Script. Anyway thank you very mush for your suggestions...

Regards

Sudheesh K S
15 years ago
Hi,

I am using Struts Upload Bean. I am also using html:file tag in the JSP. Now when i click on the browse button, A file dialogue window appears. The problem id the i want to show only text and xml files in the dialog box. Now the files of type combo box in the dialogue box is showing *.*, *.html, *.pictures (jpg/gif) options. In place of this i need to show only txt and xml files. How can i restrict the file type to XML and TXT

Regards,
Sudheesh...
15 years ago
Dear sirs,

I am getting some interesting Session scope Exception..
I am using the technology Struts, EJB with JBoss
I am using Session Facade and Service Locator as desin pattern
Now the scenario is given below,

I am requesting for a collection of Entity Bean by passing the request as given below,

Action Class -> Session Bean (Stateless) -> Service Locator -> Entity Bean(CMP)

I am extending my action class with org.apache.struts.actions.DispatchAction

When two users of different sessions are logging in to the application and accessing the same collection; only one user is getting the Collection.
I tried to print the session ID ob each users at the console. Before the request is made the session id of each user is different as given below,

User 1 : 257B112049648471974498E34F9B1EDC
User 2 : A674D5852CB31EA975929E833E5C90B4

But after getting the collection from the bean; when i printedthe session ID along with the Collection size; the console is printing the same session for both request as given below,

1. showMessage positionMap.size()==> 124 <=> Session Id A674D5852CB31EA975929E833E5C90B4
2. showMessage positionMap.size()==> 124 <=> Session Id A674D5852CB31EA975929E833E5C90B4

This means that the user with session "257B112049648471974498E34F9B1EDC" is not getting the collection. This problem is occuring when both users are requesting for the same collection simultaneously, I checked the beam part and service locator part. I think they are working fine.

The ServiceLocator Code is given below...

public class ServiceLocator implements ServiceNames{

private static ServiceLocator serviceLocator = null;
private static Hashtable<String,Object> ejbHomeCache = null;
private static Hashtable<String,DataSource> dataBaseCache = null;


static{
serviceLocator = new ServiceLocator();
}

private ServiceLocator(){
ejbHomeCache = new Hashtable<String,Object>();
dataBaseCache = new Hashtable<String,DataSource>();
}

public static ServiceLocator getInstance(){
return serviceLocator;
}

private static EJBHome getEJBHome(String serviceName, Class ejbHomeClass){

EJBHome ejbHome = null;
try{
if(ejbHomeCache.containsKey(serviceName)){
System.out.println("%%%%%%%%%%%%%%%%%%%%%% from ejbHomeCache Remote HashTable");
return((EJBHome)ejbHomeCache.get(serviceName));
}else{
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
properties.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");
properties.put(Context.PROVIDER_URL, "jnp://localhost:1099");
InitialContext ctx = new InitialContext(properties);
Context ctx = new InitialContext();
Object jndiRef = ctx.lookup(serviceName);
Object objRef = PortableRemoteObject.narrow(jndiRef,ejbHomeClass);
ejbHomeCache.put(serviceName, objRef);
return ((EJBHome)objRef);
}
}catch(Exception e){
System.out.println("Error in getRemoteEJBHome()-Remote in finding Remote EJBHome ");
e.printStackTrace();
}
return null;
}

private static EJBLocalHome getEJBHome(String serviceName){

EJBLocalHome ejbHome = null;
try{
if(ejbHomeCache.containsKey(serviceName)){
System.out.println("%%%%%%%%%%%%%%%%%%%%%% from ejbHomeCache HashTable");
return((EJBLocalHome)ejbHomeCache.get(serviceName));
}else{
Context ctx = new InitialContext();
Object objRef = (EJBLocalHome)ctx.lookup(serviceName);
ejbHomeCache.put(serviceName,objRef);
return ((EJBLocalHome)objRef);
}

}catch(Exception e){
System.out.println("Error in getEJBHome()-Local in finding Remote EJBHome ");
e.printStackTrace();
}
return null;
}


public static ImportsVzaHeaderLocalHome getVzaHeaderLocalHome(){
ImportsVzaHeaderLocalHome vzaHeaderHome = null;
try{
vzaHeaderHome = (ImportsVzaHeaderLocalHome)getEJBHome(VZAHeaderLocal);
}catch(Exception e){
System.out.println("From ServiceLocator's getVzaHeaderHome method Exception in finding the VzaHeaderHome ");
e.printStackTrace();
}
return vzaHeaderHome;
}
}
/************************************END Of ServiceLocator *************************************************************/

Your help and suggestions solicited..
15 years ago
Dear sirs,

I have a JSP page which is running on a server in a client session. In the JSP, i have a link which is pointing to the JSP of another application running on a different server. How can we maintain the communication in the same client session?

Regards,

Sudheesh K S
15 years ago
JSP
Dear sirs,

Can we preserve Connection object using any of the desin pattern such as service locator?
Will the container close the connection itself after some idle time? If that is the case, how can we preserve the connection?
I heard that to obtain a connection every time, is additional overhead to the container..

Thank you,
Sudheesh K S
Dear sirs,

Can we preserve Connection object using any of the desin pattern such as service locator?
Will the container close the connection itself after some idle time? If that is the case, how can we preserve the connection?
I heard that to obtain a connection every time, is additional overhead to the container..

Thank you,
Sudheesh K S
[ October 06, 2005: Message edited by: Bear Bibeault ]
Dear sirs,

I have a J2ee application which is running in JBOSS Server. The Data tier is MySql. We are using CMP
Now the scenario is like this,
We are having two clients, and the clients have different sub users. The clients are using two seperate database for the same application. Now the application is working in two different servers assigned for each clients. Now we are planning to integrate it to a single application . I would like to know whether
1. Is it possible to specify the JNDI names for more than one database in the deployement descriptor?
2. if it is then, how can we instruct the container to lookup dynamically for the appropriate database based on the user logged in to the application .
I am planning to setup a new DB for the users information sothat the container can select the appropriate DB based on the user logged in...

Thankyou,
Sudheesh K S,
Dear sirs,


I have a JSP page that includes a javascript file as given below,
<script type="text/javascript" src="../scripts/validation.js"></script>
Some times modification is needed in this included script file. After the modification, when I load the JSP page in the browser,
the old copy of the script file, which was not modified is getting executed. by the browser.

I would like to know whether any options are availabe in javascript to prevent the browser from executing the old copy that has already downloaded to the temperary interner folder(from caching)and use the modified version available with the new response...

Thank you,