Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Dipali yadav

Greenhorn
+ Follow
since May 21, 2012
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dipali yadav

Gopakumar Naryanan wrote:Glad to know that you got the solution. Tiles framework will not let you increase number of JSPs if you use tiles-definition.xml .



okk... I ll try this.

Please share your solution to avoid someone to raise a new thread for the same issue



I did some changes into globalmenu.jsp


<html>
<body>
<table cellpadding="0" cellspacing="0" border="0" width="220px">
<tr>
<td class="nav-links">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img src="gfx/logo_lisa.png" width="220" height="70" />

<img width="5" height="10" src="gfx/transparent.gif" />
</td>
</tr>
<tr>
<td class="nav-button"><s:submit name="submitLinkBasicdata"
key="basicdata.headline" cssClass="nav-link" value="basicdata"
action="navlinkActionBasicData"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit name="submitLinkDisplay"
key="display.headline" cssClass="nav-link"
action="navlinkActionDisplay"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit
name="submitLinkMailnotification"
key="mailnotification.headline" cssClass="nav-link"
action="navlinkActionMail"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit
name="submitLinkPackagefiles" key="packagefiles.headline"
cssClass="nav-link" action="navlinkActionPackage"></s:submit></td>
</tr>
<tr>
<td class="nav-button"><s:submit
name="submitLinkDhlTrackTrace" key="dhltnt.headline"
cssClass="nav-link" action="navlinkActionDhl"></s:submit></td>
</tr>
<tr>
<td class="nav-button"><s:submit name="submitLinkPrintlayout"
key="printlayout.headline" cssClass="nav-link"
action="navlinkActionPrint"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit name="submitLinkFTP"
key="ftp.headline" cssClass="nav-link" action="navlinkActionFtp"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit
name="submitLinkManufacturing"
key="providemanufacturing.headline" cssClass="nav-link"
action="navlinkActionManufacturing"></s:submit>
</td>
</tr>
</table> <img width="5" alt="placeholder2" height="100"
src="gfx/transparent.gif" />
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="nav-button"><s:submit name="submitButtonPrint"
key="globalmenu.button.print" cssClass="nav-button"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit name="submitButtonCancel"
key="globalmenu.button.cancel" cssClass="nav-button"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit name="submitButtonSave"
key="globalmenu.button.save" cssClass="nav-button"></s:submit>
</td>
</tr>
<tr>
<td><hr />
</td>
</tr>
<tr>
<td class="nav-button"><s:submit
name="submitButtonUserManagement"
key="globalmenu.button.usermanagement" cssClass="nav-button"></s:submit>
</td>
</tr>
<tr>
<td class="nav-button"><s:submit name="submitButtonLogout"
key="globalmenu.button.logout" cssClass="nav-button" action="navlinkActionLogout"></s:submit>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="180">
<tr class="lisa_version">
<td>Ver: 2.2.4 - 24.11.2009</td>
</tr>
</table></td>
</tr>
</table>
</body></html>



And poiting these all actions to the same result. For this I have created a seperate vavlinkAction.java




And finally added these actions in struts.xml

7 years ago

Gopakumar Naryanan wrote:i think you can use tiles framework to include menu and the rest is same story. I have not worked on struts 2, please try if my words make any sense.



Thank you for your reply.....

I tried this already...but i think it is increasing number of jsp pages....
but any ways, i got the solution....and nw it is working as per my requirement...

Thanks a lot......
7 years ago
I dont knw much about struts...
but you can try this in struts.xml

7 years ago
Ohh... It means there is no solution for this....
7 years ago

Jaikiran Pai wrote:

Dipali yadav wrote:check attached image



What about it and what's the question?



I was editing the questions.......Please have a look on it now....

Thank you for your reply.
7 years ago
Please see the below image....
I am working with struts 2....... There are two jsp pages 1. global menu 2. basic data page
I have included globalmenu.jsp into basicdata.jsp
Since this globalmenu.jsp will be use by all jsp pages into my application...
I want to write a common code in a 1 single action, which will contain all results for the links on global menu
And also I want to write an another action for other part of the page.

My code is something like this:

globalmenu.jsp



basicdata.jsp



In short I want to write a 1 common action for menu links which i highlighted in the image.....

I am waiting for reply

Thanks in advance.....
7 years ago
I checked all the code.........please help me out..
7 years ago

jatan bhavsar wrote:hi Dipali,

Please carefully look at the stack trace it shows the error at

at com.otto.lisa.web.NewUserForm.validate(NewUserForm.java:434)

.. Post the code for the NewUserForm.java.

The error line is mentioned. Post some more info with code.

Jatan




Thanks for the reply Jatan

Here is my code for NewUserForm.java




As per your suggestion i checked at

if (this.getPassword().trim().length() < 8) {
if (errors == null)
errors = new ActionErrors();
errors.add("securepassword",new ActionError("newuser.securepassword"));
}


I did following changes as well

else if (this.getPassword().trim().length() < 8) {
if (errors == null)
errors = new ActionErrors();
errors.add("securepassword",new ActionError("newuser.securepassword"));
}

else if (!this.getPassword().matches(upperCaseChars)) {
if (errors == null)
errors = new ActionErrors();
errors.add("securepassword",new ActionError("newuser.securepassword"));
}



but at the end it is giving following error...........




Error 500--Internal Server Error
java.lang.NullPointerException
at jsp_servlet.__newuser._jspService(__newuser.java:510)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:505)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:251)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1014)
at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:961)
at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:931)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:247)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:505)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:251)
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.doPost(ActionServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)



Please suggest...........

Dipali
7 years ago
Hello all,

I am working with struts 1.2. I want to validate one form using ActionErrors validate() method.
But when try to open my jsp page, it gives me null pointer exception for it.
I am using weblogic server....

Here is the error


Error 500--Internal Server Error
java.lang.NullPointerException
at com.otto.lisa.web.NewUserForm.validate(NewUserForm.java:434)
at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:893)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:247)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:505)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:251)
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.doPost(ActionServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)


Please help..........its urgent...

Thanks in advance.

7 years ago

yes.........SessionAware is working finally...

But how to put model into this session and pass it to another action?? or to the util class

Any idea??
7 years ago

Yogesh Lonkar wrote:To use Session-aware interface you need to have struts2-core-2.0.6.jardownloadhere or higher version of struts-core in your WEB-INF/lib folder



Thank you for the reply........

I am already using struts2-core-2.2.1.1.jar
here is a list of jar files which i m using in my application :

commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-logging-1.0.4.jar
commons-validator-1.3.1.jar
freemarker-2.3.16.jar
javassist-3.11.0.GA.jar
mysql-connector-java-5.0.8-bin.jar
ognl-2.7.3.jar
ognl-3.0.jar
struts2-convention-plugin-2.2.1.1.jar
struts2-core-2.2.1.1.jar
xwork-core-2.2.1.1.jar

7 years ago

sneha ulhe wrote:Hi,session is bydefault available in jsp pages.we can create session it in Action class.struts also provides the SessionAware interface.



Can you please tell me how to use SessionAware? As i m using it i m getting an error that :-
packake not fount.........package org.apache.struts2 does not exist [javac] import org.apache.struts2.ServletActionContext;
and symbol not found........cannot find symbol [javac] symbol: class SessionAware
7 years ago
Hi,

I am not able to add session in struts 2 apllication properly. When i implement sessionaware in my action class it gives me an error that
[1] cannot find symbol [javac] symbol: class SessionAware
[2] package org.apache.struts2 does not exist [javac] import org.apache.struts2.ServletActionContext

Please please help me. I never work with sessions before this.

And do let me know is there any other way to add session in the struts2 application..

I am using struts 2.2.1.1 and weblogic server
7 years ago

@heat rs,


I have fixed the problem,

solution is to use correct jar files, I was using ognl-3.0 , so when I switched to ognl-2.7.3 & also added javassist.jar it worked.



Thanks a lot..........
This post helps me a lot. I was suffering with this problem from last 2 days..
Thanks...........
8 years ago
May I know how to reload the page...............
This might be a silly question but I really don't know...
8 years ago