usha kotha

Ranch Hand
+ Follow
since Apr 18, 2012
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 usha kotha

Hi,

I am new to struts2, Could you please help me out in providing a sample code for printing a page using struts2 as soon as possible.

Thanks in Advance
11 years ago
Hi,
Could you please help me out in doing connection pooling in GlassFish rather than hibernate.cfg.xml,
Where as i have a scenario in which i maintained connection pooling in Tomcat level,context.xml is been added with the resource tag,in which i have connection pooling details and in web.xml i have datasource .
In the same way guide me the solution for Connection pooling in Glassfish.Thanks in advance
11 years ago
Hi,
I am back with a question,anyone can help me out in maintaining connection pooling in GlassFish rather than in Hibernate level.
I am awaiting for the quick response.Thanks in advance
11 years ago
here is my jsp


<%-- <%
response.setHeader("Pragma", "no-cache");
%>


<%
response.setHeader("Cache-Control", "no-store");
%>
<%
response.setDateHeader("Expires", -1);
%> --%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Add Candidate</title>
<link href="style2.css" rel="stylesheet" type="text/css" />
<sx:head parseContent="true" />
<script type="text/javascript">
function Checkfiles() {
var fup = document.getElementById('upload_filename');
var fileName = fup.value;
//alert (fileName);
var ext = fileName.substring(fileName.lastIndexOf('.') + 1);
//alert (ext);
if (fileName == "") {
alert("Please select a file to Upload");
return false;
} else if (ext == "doc" || ext == "DOC") {
return true;
} else {
alert("Make sure to upload only .doc files");
fup.focus();
return false;
}
}
</script>
</head>

<body>
<%@ page errorPage="errorpage.jsp" %>
<%@ include file="QuickSearch.jsp"%>

<form name="frm" action="AddCandidate" method="post"
enctype="multipart/form-data">
<%@ include file="MainPage.jsp"%>


<!--Menu ends here-->

<!--Content Starts here-->


<div class="wrapper">

<div class="cont1"></div>

<div class="cont2">
<div class="title">Add Candidate</div>
<div class="centent">
<div class="conbox1">

<div class="fields">
<h1>Identification</h1>

<div class="formbox_in">
<s:textfield label="First Name" name="firstName"
value="%{firstName}" maxlength="25" required="true"
style="border:1px solid #ccc; background:#fff; width:165px;" />

<s:hidden name="userName" value="%{userName}" maxlength="15"
style="border:1px solid #ccc; background:#fff; width:165px;" />
<s:hidden name="roleInfo" value="%{roleInfo}" maxlength="15"
style="border:1px solid #ccc; background:#fff; width:165px;" />

</div>

<div class="clear"></div>

<div class="formbox_in">
<s:textfield label="Middle Name" name="middleInitial"
maxlength="25"
style="border:1px solid #ccc; background:#fff; width:165px;" />

</div>

<div class="clear"></div>

<div class="formbox_in">
<s:textfield label="Last Name" name="lastName"
value="%{lastName}" maxlength="25" required="true"
style="border:1px solid #ccc; background:#fff; width:165px;" />

</div>

<div class="clear"></div>

<div class="formbox_in">

<!-- <label class="label" for="gender">Gender:</label>
<input type="radio" value="1" id="gender1" name="gender" style="float: left; margin-left: 10px; margin-top: 4px;">
<label for="gender1" style="width: 45px; text-align: left; margin-left: 5px;">Male</label>
<input type="radio" value="2" id="gender2" name="gender" style="float: left; margin-top: 4px;">
<label for="gender2" style="text-align: left; width: 50px; margin-left: 5px;">Female</label> -->



<s:radio label="Gender" name="gender" required="true"
list="#{'1':'Male','2':'Female'}" />

</div>

<div class="clear"></div>

</div>

<div class="fields">
<h1>Contact Details</h1>

<div class="formbox_in">
<s:textfield label="Address" name="address" maxlength="30" required="true"
style="border:1px solid #ccc; background:#fff; width:165px;" />

</div>

<div class="clear"></div>

<div class="formbox_in">
<s:textfield label="City" name="city" maxlength="30" required="true"
style="border:1px solid #ccc; background:#fff; width:165px;" />

</div>

<div class="clear"></div>

<div class="formbox_in">
<s:select label="State" name="state" headerKey="Select" required="true"
headerValue="Select" list="states" listKey="value"
listValue="value"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" />

</div>

<div class="clear"></div>

<div class="formbox_in">
<s:textfield label="Zip" name="zip" required="true"
maxlength="6"
style="border:1px solid #ccc; background:#fff; width:165px;" />

</div>

<div class="clear"></div>


<div class="formbox_in">
<s:select label="Country" name="country" headerKey="United States" required="true"
headerValue="United States" list="countries" listKey="value"
listValue="value"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" />

</div>

<div class="clear"></div>


<div class="formbox_in">
<s:textfield label="Home Phone" name="homePhone"
value="%{homePhone}" maxlength="15"
style="border:1px solid #ccc; background:#fff; width:165px;" />

</div>

<div class="clear"></div>


<div class="formbox_in">
<s:textfield label="Cell Phone" name="cellPhone"
value="%{cellPhone}" maxlength="15"
style="border:1px solid #ccc; background:#fff; width:165px;" />

</div>

<div class="clear"></div>


<div class="formbox_in">
<s:textfield label="Email" name="emailId" value="%{emailId}"
maxlength="50" required="true"
style="border:1px solid #ccc; background:#fff; width:165px;" />

</div>

<div class="clear"></div>


<div class="formbox_in">
<s:textfield label="Alternate Email" name="altEmail"
maxlength="50"
style="border:1px solid #ccc; background:#fff; width:165px;" />

</div>

<div class="clear"></div>


</div>
</div>

<div class="conbox2">

<div class="fields">
<h1>Highest Education</h1>

<div class="formbox_in">
<s:select label="Education Level" name="educationLevel"
headerKey="Select" headerValue="Select"
list="{'Doctorate','Masters','Associate','Bachelors','High School'}"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" />

</div>

<div class="clear"></div>


</div>


<div class="fields">
<h1>Status</h1>

<div class="formbox_in">
<sx:datetimepicker name="dateAvailable" formatLength="medium"
label="Date" displayFormat="MM/dd/yyyy"
value="%{dateAvailable}" type="date"
cssStyle="border:1px solid #ccc; width:165px;" />

</div>
<div class="clear"></div>

<div class="formbox_in">
<s:select label="Work Permit Type" headerKey="Select" required="true"
headerValue="Select" name="workPermit"
list="{'Citizen','H1','F1-OPT','Other'}"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" />

</div>
<div class="clear"></div>

<div class="formbox_in" style="margin-top: 20px;">
<%-- <s:select label="Status" headerKey="-1" headerValue="Any" value="-1"
name="status" multiple="true"
list="listOfStatus" listKey="statusName" listValue="statusName"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" /> --%>
<s:select label="Status" headerKey="-1"
name="status" multiple="true" value="%{statusMultiList}" required="true"
list="listOfStatus" listKey="statusName" listValue="statusName"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" />
<%-- <s:select label="Status" headerKey="-1"
name="status" multiple="true" required="true"
list="listOfStatus" listKey="statusName" listValue="statusName"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" /> --%>

</div>
<div class="clear"></div>

<div class="formbox_in" style="margin-top:60px;">
<s:select label="Sourcer" name="sourcer" required="true"
headerKey="Select" headerValue="Select" list="listOfSourcers"
listKey="%{firstName+' '+lastName}"
listValue="%{firstName+' '+lastName}"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" />

</div>

<div class="clear"></div>


</div>

<div class="fields">
<h1>Resume</h1>

<div class="formbox_in">
<s:file id="upload_filename" name="upload_filename"
label="Resume " style="border:1px solid #ccc; margin-left:10px;" />

</div>
<div class="clear"></div>



</div>

</div>
<div class="clear"></div>
<div class="conbox">
<div class="formbox" style="width:54px; margin-top:15px;">
<input type="submit" name="submit" align="right" value="Save"
class="title_bg" style="width: 54px;" />
</div>
</div>
</div>

</div>

<div class="cont3"></div>
</div>
</form>
</body>
</html>






jatan bhavsar wrote:Hi Usha,

Can you post your whole jsp as i put the line you mention and it worked perfectly. Have you made any changes in default theme provided by struts as you have mention theme="simple" explicitly.

Regards
Jatan bhavsar

11 years ago
<s:radio label="Gender" name="gender" required="true" list="#{'1':'Male','2':'Female'}" theme="simple" />


when i put this code the view changed like this..............with no label and more jumbled than before

Joe Ess wrote:Can you show us some code?

11 years ago
but i have already tried this. it made no impact.

Joe Ess wrote:See the FAQ Why do the form tags put table tags around controls




11 years ago
Struts radio button is not aligned properly. I have used the below struts tag for radio buttons. But the alignment of male and female radio buttons got jumbled. I don't want to convert this struts tag to input tag for UI design purpose. Please help me............ I have googled a lot but couldn't find a solution. I have attached the part of my jsp view which shows you how the radio buttons got jumbled.

<s:radio label="Gender" name="gender" required="true" list="#{'1':'Male','2':'Female'}" />



Please help ASAP
11 years ago
how to use s:merge tag or s:append tag output(result, i.e list) in s:select tag list attribute

i have a select tag in display column of display table............i want result of merge tag or append tag as value for list attribute

<s:append var="appendId">
<s:param value="%{myList}" />
</s:append>

<display:column>
<s:select name="currentStatus" headerKey="Select" headerValue="Select" list="appendId" listKey="currentStatus" listValue="currentStatus" style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" />
</display:column>
11 years ago
Please provide links to Download Eclipse WTP 2.0 or greater versions


thanks in advance
11 years ago
Hi im back with a query,in my jsp im using display tag and im iterating a list ,i have two columns one is checkbox its value is some id(from the list),and another column is browsing a file,here is part of my jsp

<display:table id="list1" name="candidateList" requestURI=" "
pagesize="10"
style="width: 1000px; margin: 0px auto; color:#0000ff; font-family:verdana; font-size:12px;"
export="true">
<display:column title="">
<input type="checkbox" id="checkbox" name="select"
value=${list1.candidateId } />
</display:column>
<display:column title="Resume Upload">
<s:file id="upload_filename" name="upload_filename" theme="simple"
style="border:1px solid #ccc;" />
</display:column>
<display:column property="candidateId" title="Id" sortable="true" />
<display:column property="firstName" title=" First Name"
sortable="true" />
<display:column property="lastName" title="Last Name" sortable="true" />
<display:column property="emailId" title="Email" sortable="true" />
<display:column property="cellPhone" title="Cell Phone"
sortable="true" />



here in the above code,if check the first two checkboxes and browse the third row then here im attaching the checked rows with the third browsed file.....but it should not happen,i need to validate it like,
please browse the appropriate checked rows ....im awaiting for your response....thanks in advance....



Hi Im back with some other query....

While im working with cascading dropdown,here is my script

function show_details() {
dojo.event.topic.publish("show_detail");
}

here is my dropdown after selecting some value from this dropdown im taking this value to action class JobAction.....

<s:select label="Business or Business Id" name="business" headerKey="Select" headerValue="Select" list="ListOfClients" listKey="%{business}" listValue="%{business}" required="true" style="border:1px solid #ccc; background:#fff; width:165px;" onchange="javascript:show_details();return false;"/>
<s:url id="d_url" action="JobAction" /> <sx:div id="details" href="%{d_url}" listenTopics="show_detail" formId="frm" showLoadingText=""></sx:div>


but im unable to return back to the same jsp with some list for second dropdown......
its throwing error like
Before selecting value from dropdown:

Error loading '/JATS/JobAction.action' (500 Internal Server Error)

after selecting value from first dropdown its going to action class with the selected value from dropdown....
but here in this action class im unable to return to the same jsp with some list
its throwing error like:

Couldn't load content:Unknown runtime error

in standard error log its throwing error like:
ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@a75737')

could you please help me out in finding solution for this
thanks in advance


11 years ago
yes, am familiar with AOP. What i mean is.........i want to use AOP to generate logs when an exception occurs, while entering or exiting a method...........like generating logs using log4j. Using pointcut expressions, i want to generate logs. But i don't want to use IOC/Dependency injection.

I want to track my struts2 DAOs and helper classes which integrate strut2 with hibernate.
Could anyone please help me in integrating struts2 with aop(without using spring) to generate logs.

I would be so pleased if you could post code snippets for integration step by step or a few links which would explain clearly.