Thilothama Green

Greenhorn
+ Follow
since May 13, 2004
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 Thilothama Green

Hi,

In a web based application, with simple architecture like

Struts - Transfer Objects - Business Tier,

Which is the best way to keep SQLs?

1. In Interface?
2. In properties file?

And also please include Disadv and Adv of each approach. If any other approach is there, please explain that too..

But not middlewares like Hibernate or whatever..

Thanks
Thilothama
16 years ago
I have a webpage designed with Tiles. I am doing a tab layout. My tiles definition is as follows.

<tiles-definitions>

<definition name="sabrixui.tabs.page" path = "/crossChargesModify.jsp">
<put name="title" value="Cross Charges Maintenance" />
<put name="body" value="sabrixui.tabs.body" />
</definition>
<!-- body using tabs -->
<definition name="sabrixui.tabs.body" path="/crossChargesModifyTabs.jsp" >
<put name="selectedIndex" value="0" />
<put name="parameterName" value="selected" />
<putList name="tabList" >
<item value="Cross Charges"
link="/crossChargesDetailsModify.jsp" />
<item value="Percentages"
link="/crossChargesSplitModify.jsp" />
</putList>
</definition>
</tiles-definitions>

I want to go to action class when the links of the tabs are clicked. If I make the link property of the item tag as action- crossCharges.do, How will the JSP's be loaded again in the tab fashion? if I give forwards for the above jsps?
16 years ago
I am still waiting on this question. Can you please me your suggestions?

Thanks
Thilothama
16 years ago
Hi

Is there any other option available to implement tabs, datagrids and many dynamic functionalities in a struts page than struts-layout??

Any suggestion is greatly appreciated..

Thanks
Thilothama
16 years ago
Hi
I am using struts layout for Datagrid. I am using DispatchAction. I am getting the following error..Can anyone suggest a solution?

[Servlet Error]-[org.apache.struts.util.RequestUtils: method getActionMappingName(Ljava/lang/String;)Ljava/lang/String; not found]: java.lang.NoSuchMethodError: org.apache.struts.util.RequestUtils: method getActionMappingName(Ljava/lang/String Ljava/lang/String; not found
at fr.improve.struts.taglib.layout.FormTag.computeActionName(FormTag.java:159)
at fr.improve.struts.taglib.layout.FormTag.computeActionParameter(FormTag.java:148)
at fr.improve.struts.taglib.layout.FormTag.processRequestCode(FormTag.java:126)
at fr.improve.struts.taglib.layout.FormTag.doStartLayoutTag(FormTag.java:105)
at fr.improve.struts.taglib.layout.LayoutTagSupport.doStartTag(LayoutTagSupport.java:34)
at org.apache.jsp._errorCodes._jspService(_errorCodes.java:163)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:598)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:696)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:258)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:872)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:491)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:173)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1014)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:417)
at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:390)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:271)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:258)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:872)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:491)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:173)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:199)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:331)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:432)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:343)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:592)

My jsp is having
<layout:form action="/errorCodes" reqCode="update" styleClass="PANEL">
<layout:row>
<layout atagrid property="datagrid" selectionAllowed="true" multipleSelectionAllowed="false" model="datagrid">
<layout atagridColumn title="ErrorCode" property="errCode" />
<layout atagridColumn title="Description" property="errDescription" />
<layout atagridColumn title="Error Group" property="errGroup" />
<layout atagridColumn title="Error Level" property="errLevel" />
</layout atagrid>
<layout:column>
<layout:submit reqCode="update">Save</layout:submit>
</layout:column>
</layout:row>
</layout:form>

Action class is having update method as

public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse reponse) {
try {
HttpSession session = request.getSession(true);
String validuser = (String) session.getAttribute("validuser");
String userID =((String) session.getAttribute("userID")).trim().toUpperCase();
if (validuser == null) {
System.out.println("not valid user");
return (mapping.findForward("login"));
}
DatagridForm lc_form = (DatagridForm) form;

ErrorCodesDAO[] errAllBeanList = null;
ErrorCodesSQLCaller errSQLCaller = new ErrorCodesSQLCaller();
errAllBeanList = errSQLCaller.getAllError();
List list = Arrays.asList(errAllBeanList);

// Create a datagrid.
Datagrid lc_datagrid = Datagrid.getInstance();
lc_datagrid.setDataClass(ErrorCodesDAO.class);
// Set the data
lc_datagrid.setData(list);

lc_form.setDatagrid(lc_datagrid);
}catch (Exception e) {
}
return (mapping.findForward("errorCodes"));
}

My Form is

public class DatagridForm extends ActionForm {

private Datagrid datagrid;

public void setDatagrid(Datagrid in_datagrid){
datagrid = in_datagrid;
}

public Datagrid getDatagrid(){
return datagrid;
}

}

My Struts-config is having

<form-bean name="datagridForm" type="com.dcx.tax.sabrix.forms.DatagridForm">
</form-bean>

<action name="datagridForm" validate = "false" parameter = "reqCode" path="/errorCodes" scope="session" type="com.dcx.tax.sabrix.actions.ErrorCodesAction">
<forward name="errorCodes" path="/errorCodes.jsp">
</forward>
</action>

I am calling the action from menu.jsp like

<A href="errorCodes.do?reqCode=update">
</A>

Thank you,
Thilothama
16 years ago
Hi

Could you please suggest me a better way to use tabs in jsp. I looked into struts layout tags. Is there anything else we can do? or mostly followed practice is struts layout?

Thanks
Thilothama
16 years ago
I have two jsp pages in a tab structure. One of the pages in the tab works fine for the dispatch function. Only the other page is not working. I found out that not even any javascript is working in that page. Working on it.

Thank you all for your help.

Thilothama.
16 years ago
I am submitting the form and I could do some other operations.
16 years ago
Hi,

I have 2 jsp pages using same Form and same Action Class.
Page contains a list of values and on clicking any one of the list, goes to second page which is a tabbed page.

I am having a hidden variable pageDispatch in all the pages and on submit of any pages's form, I set the dispatch with that particular page's value.

I have my action form bean in session scope. The javascript I use to set the dispatch shows that the value is set(I used alerts). But when in the action, if I try to get that dispatch value, its showing the default value I set for it in the page. What am I missing?

Thanks
16 years ago
Hi

Yo do not need Jsp:usebean when you are using logic:notpresent. Logic tag itself goes to that scope and search for your bean. If null - not present, it will go to your page. I think you do not need jsp.usebean.

I am also new to struts..I may be wrong. But try using only the logic tag and see..

Thanks
Thilothama
16 years ago
Hi all,

I am working in struts and I have a scenario. I have 2 web pages. First page has a table which displays values from a database table like
code, description.
Description columns values are all hyperlinks and when clicked goes to the second page where code, description and other select box is there. All these values correspond from the first page. I want to populate that select box with the value for it from the database.

eg . 1st page code, description
1 Desc 1
2 Desc 2

on clicking desc 1 goes to 2nd page with text box for code and desc and a select box to assign category for that particular record.

How do i make the select box on load get selected with the value of the desc's category....

i can load the select box from the database but couldnt make it selected with a particular value..

give me ur suggestions

thilothama
16 years ago
Hello everyone,
I have a problem with multibox operations in my form.So please help me as soon as possible. Any help in this regard is greatly appreciated.

I have a form with rows generated dynamically. for every row there is a checkbox and two text boxes associated with it. checkbox, textbox1, textbox2 are defines as arrays in actionform and I am getting the values in action class. I am using Struts Multibox to display the checkbox.

At the beginning when the form is displayed all the checkboxes are not checked (unchecked) and I want all the text boxes to be disabled.
upto this point I am getting the result.<html:text property="Amount" size="10" disabled="true"/>
There is a save button in this form which saves the rows for which the checkbox is checked and textboxes are entered with values.
-------------------------------------------------------

I am having difficulty doing these!
Q1) when the user clicks the checkbox , the textboxes associated with that checkbox ( that is same row) should be enabled to enter some data.
If the user clicks 2, 5, 6 checkboxes only textboxes for those rows should be enabled. if the user does not enter data in text boxes and tries to save it, it needs to pop up a message to enter data in the textbox
first before saving.

for this I am thinking of calling _javascript function in the <html:multibox property="saveselections" onfiltered="enabledTextFields()">

First of all is this approach right? how to write this in _javascript?

Q2) what is the best approach to define the type of the text box in actionform when amount (ex $10,000.00) needs to be entered.
In action class I need to convert to BigDecimal. so can I define it as BigDecimal in actionform itself?

Thank you for your help!!

Thilothama.
16 years ago
Hi all,

I am planning to take SCJP 035 - 1.4. I can prepare full time for this exam ...I have 2 to 3 years of Java experience. I would like to know whether I will need one or 2 full months for this or I can do even before that...

Thanks for any help in this regard.

Thilothama..