Mano haran

Greenhorn
+ Follow
since Nov 30, 2006
Merit badge: grant badges
For More
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 Mano haran

Hi,

i am new to struts, now i exploring struts with database access,i am getting error in my datasource,
my code snippet,

String user=null;
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;

ServletContext ctx=servlet.getServletContext();
DataSource ds=(DataSource)
ctx.getAttribute(Action.DATA_SOURCE_KEY);
try
{
conn=ds.getConnection();
stmt=conn.createStatement();
//some other codes here
}
here Action.DATA_SOURCE_KEY this is giving error to me,also i have pasted my struts-config.xml data source configuration

<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName"
value="oracle.jdbc.driver.OracleDriver"/>
<set-property property="url"
value="jdbc racle:thin:@mac-0314:1521 RCL" />
<set-property property="username" value="scott" />
<set-property property="password" value="tiger" />
<set-property property="maxActive" value="10" />
<set-property property="maxWait" value="500" />
<set-property property="defaultAutoCommit" value="false" />
<set-property property="defaultReadOnly" value="false" />
</data-source>
</data-sources>

please help me ...
16 years ago
hi,
In my struts Applicaiotn,i am using two bean classes,one is for existing user another for new user.its for assumption only,i am not using any database. When existing user try to login it forward one result page(EmpAdmin.jsp) there,i am getting his name from "loginForm" bean.

if user try to login using new user registration,i am getting registration details from another bean,after its success,i am forwarding to same result page(EmpAdmin.jsp).

here the problem is when i try to login using existing user, other bean values are getting null,also its displaying null values in result jsp.So
how to hide from existing user. i have attatched code snippet for
struts-config.xml



<action path="/gotoEmpAdmin"
type="com.emp.AdminUserAction"
name="loginForm">
<forward name="home" path="/index.jsp"/>
<forward name="success" path="/jsp/EmpAdmin.jsp"/>
</action>



<action path="/goNewUser"
type="com.emp.NewUserAction">
<forward name="success" path="/jsp/NewUserFormData.jsp"/>
</action>


<action path="/processNewUser"
type="com.emp.ProcessNewUserAction"
name="newuserForm">
<forward name="success" path="/jsp/EmpAdmin.jsp"/>
<forward name="failure" path="/jsp/NewUserFormData.jsp"/>
</action>
16 years ago
I have selected option "Run on Server". At this only that is giving error message to me
hi,
i have imported a Ejb project into my eclipse. I have configured all jar files which is need for that project. but while i am try to run its giving error message "The Selection did not contain anything that can be run on server" what could be the problem?
hi,

In an struts application,When struts-config.xml file load? and what is request processor?
what is the purpose of request processor?
last but not least where we write our business logic in struts?
is it action class or bean class(model)
16 years ago
Hi,

i am new to Servlets, i need materials for servlets. also give some useful links for reading servlets.
16 years ago
hi,
what is the internal need for a java filename should have same name as
the class name, which have the main method?.

is there any special reason over there?
16 years ago

Originally posted by Raghavan Muthu:
have you configured your taglib-uri and tablib-location in web.xml?



yes i have configured web.xml file, as follows

<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>

but still now i am getting this error.
16 years ago

Originally posted by Raghavan Muthu:
have you configured your taglib-uri and tablib-location in web.xml?

16 years ago
Parsing of JSP File '/welcome.jsp' failed:
--------------------------------------------------------------------------------
/welcome.jsp(3): Error in using tag library uri='/WEB-INF/struts-html.tld' prefix='html': The Tag class 'org.apache.struts.taglib.html.FormTag' has no setter method corresponding to TLD declared attribute 'name', (JSP 1.1 spec, 5.4.1)
probably occurred due to an error in /welcome.jsp line 3:
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
16 years ago
i want to know about thread safe programming?. how it will work?.





Thanks & Regards
Mano
Actually i am new to javaranch forum.also this is my first post, thats why i made mistake.Thank you for your information.i will check my answer from JSF home page.

Thanks a lot :

confused:
Actually i am new to javaranch forum.also this is my first post, thats why i made mistake.Thank you for your information.i will check my answer from JSF home page.

Thanks a lot :

confused:
16 years ago
JSF
i am learning jsp right now, meanwhile i heard about JSF. i want to know about JSF?. is this jsp and jsf both are same?.please give me the solution.
i am learning jsp right now, meanwhile i heard about JSF. i want to know about JSF?. is this jsp and jsf both are same?.please give me the solution.
16 years ago
JSF