Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

guthula lakshman

Greenhorn
+ Follow
since Sep 24, 2007
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 guthula lakshman

Hi friends

i need to read the image from the display tag..i used in my project like this


<display:column property="userRate" title="UserRate"sortable="true" >">

</display:column>

where property="userRate" id the name the form bean and i am reading the relative path of the image .


my problem is that i am not able to display the image in the .jsp page. so please give the correct procedure to display the image using display tag.




Thanks you advance


with Regards
lakshman

11 years ago
Hi shen

thanks for your Response . what you suggested i tried but i didn't get it to me. i changed the some minute things then it's working to me.

i changed like this :-

<display:table name="myApplicationForm.applicationList"pagesize="5" defaultsort="2" class="com.xyz.domain.VendorValue" >

<display:column property="appName" title="Name" sortable="true" />
<display:column property="appType" title="Type" sortable="true" />
<display:column property="totalDownloads" title="Total Downloaded" sortable="true" />
<display:column property="displayPage" title="Display Page" sortable="true" />
</display:table>


myApplicationForm is the name of the form bean and i removed the use bean tag here.

and again i am getting some problem to me..

first page i am able to populating the record but when i used to click the next page the value is not populating to another " it showing me that "Nothing found to display" and i seen the server console it showing no error.


please suggest me the solution.


with Regards
G.Lakshman





11 years ago
Hi

i am using struts.13 , in that i am using Display tag to display list of records in page wise and i placed all neccesary jar files,like displaytag-1.2.jar in lib folder and every thing working fine. what my problem is that not displaying the values from database it shows error


An error occurred while evaluating custom action attribute "value" with value "${applications.appName}": Unable to find a value for "appName" in object of class "com.xyz.ui.form.MyApplicationForm" using operator "." (null)

and i placed the the following code in the jsp page.


<jsp:useBean id="applications" class="com.xyz.ui.form.MyApplicationForm " />

<display:table id="vendors name="${applications.applicationList}" sort="list" pagesize="5" defaultsort="2">
<display:setProperty name="basic.show.header" value="true" />
<display:column property="appName" title="Name" sortable="true" />
<display:column property="appType" title="Type" sortable="true" />
<display:column property="totalDownloads" title="Total Downloaded" sortable="true" />
</display:table>


please give me the suggestion to display the list of records from the database. It's urgent to me.

Any other way is there to work on pagination concept using jsp or struts.


Thanks for you advance


with regards
lakshman


11 years ago
Hi
i am working in struts1.3 and i am using the struts validation framework .while using i am getting the following error.


java.lang.IllegalArgumentException: The path of an ForwardConfig cannot be null
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:70)
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


i added the necessary plugin to the validator framework to the struts-config.xml:-


<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
</plug-in>

and in strut-config.xml in action class the i changed like this ie " validate=true" :-

<action
path="/vendorsignup"
type="com.mobitail.ui.action.VendorSignupAction"
name="VendorSignupForm"
scope="request" validate="true" >
<forward name="success" path="/vendor/vendorsignup.jsp"/>
</action>

and in ActionForm i added like this:-


import org.apache.struts.action.ValidatorForm;

public class VendorSignupForm extends ValidatorForm

{

-------------
------------------

}


and i changed the neccessary in struts - validation :-- Eventhough i getting the following error. please give me the suggestion . it's urgent to me.




with Regards
Lakshman


11 years ago
hi pple
>
> i have an application written using JSPs and Servlets. my next step is to
> use Struts and modify it.
>
>
>
> am using struts 1.0.2, Tomcat 5.0.12
>
> this is what i did:
>
> i placed:
> -- struts.jar in the C:\Tomcat_5.0\webapps\struts\WEB-INF\lib folder
> -- all .tld files in the C:\Tomcat_5.0\webapps\struts\WEB-INF folder
> -- servlet-api.jar and struts.jar in C:\j2sdk1.4.2\jre\lib\ext folder
>
> i have a LoginBean.java, LoginAction.java and LoginForm.java from the
> website above. i have merely compiled them and placed them along with the
> MessageResources.properties file in the:
> C:\Tomcat_5.0\webapps\struts\WEB-INF\classes\test\struts folder.
>
> i have placed LoginView.jsp and MainMenu.jsp in:
> C:\Tomcat_5.0\webapps\struts\jsp folder.
>
> i have followed all the instructions!!
>
> i started Tomcat 5.0 server and when i request for:
>
> http://127.0.0.1:8080/struts/jsp/LoginView.jsp in my browser, i get the
> following error message:
>



HTTP 500 status Error

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

root cause

javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.addemployee_jsp._jspService(addemployee_jsp.java:92)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

root cause

javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:741)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
org.apache.jsp.addemployee_jsp._jspx_meth_html_005fform_005f0(addemployee_jsp.java:109)
org.apache.jsp.addemployee_jsp._jspService(addemployee_jsp.java:77)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)




could anybody solved my problem . i placed all action class and form class correctly.


With Regards
Lakshman
11 years ago
Hi,

I given as follows in index.jsp

<s:url id="url" value="pages/selectTag.jsp"/><s:a href="%{#url}">SelectTag - from jsp to action</s:a>

when i run the project i get this page with a link.. when i click the link it takes to jsp page(http://localhost:8080/Sample/pages/selectTag.jsp) where i use <s:select> tag


how can i access directly thru action? since the list has to populate and show it to users choosing their country, so jsp page should be called na.... one thing is to pre-populate countries may work based on your suggestion but then how can i redirect to jsp page? ...

can you please provide me the code... so that i can try and get solved ...

Thanks again for your time and prompt reply,
Lakshman.
11 years ago
Hi Newton,

I removed super() from POJO class and removed set method from execute() and also changed the list to generic type ..

but still it doesnt work.

struts.xml is as follows:





Also i have a suggestion that I have seen lots of people asking questions on <s:select> tag... i doubt, will <s:select> tag populate from bean/database? or mistake in struts2 framework? if not, you guys can provide a complete working example here.. so that many people get solved their problem na..

please consider this as a valid request

Thanks again for your time and prompt reply,
Lakshman.
11 years ago
Hi Sonny Gill,

Thanks for your reply..

i was trying like this : list="{countryList}" .. Its typing mistake.... list="countryList"

almost its one week.. could not get the solution

Thanks again for your time and prompt reply,
Lakshman.
11 years ago
Hi Sonny Gill,

Thanks for your reply..

i have provided System.out.println() command in getter/setter methods of countryList, in constructor, and in execute method. and the result is as follows:

Feb 7, 2009 5:29:58 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 8643 ms
In Constructor: [com.action.CountryVO@11ed166, com.action.CountryVO@45aa2c, com.action.CountryVO@1a734ff]
Feb 7, 2009 5:30:05 PM com.opensymphony.xwork2.validator.ActionValidatorManagerFactory <clinit>
INFO: Detected AnnotationActionValidatorManager, initializing it...
In getCountryList(): [com.action.CountryVO@11ed166, com.action.CountryVO@45aa2c, com.action.CountryVO@1a734ff]
In setCountryList(): [com.action.CountryVO@11ed166, com.action.CountryVO@45aa2c, com.action.CountryVO@1a734ff]
In execute(): [com.action.CountryVO@11ed166, com.action.CountryVO@45aa2c, com.action.CountryVO@1a734ff]
In getCountryList(): [com.action.CountryVO@11ed166, com.action.CountryVO@45aa2c, com.action.CountryVO@1a734ff]

I am not getting proper values .. and the select tag is empty when executing the program (means, empty drop-down list)


Please have a look on my java program :



and my JSP is :



Is anything wrong in this program?


Thanks again for your time and prompt reply,
Lakshman.
11 years ago
Hi Sonny Gill,

Thanks for your reply..

We have a list of countries added in class file using ArrayList (as shown in the first post of this thread). we have to display those countries in a jsp page as dropdown list using <s:select> tag of struts2.

we have added necessary getter/setter methods and execute method (POJO) as follows

public List getCountries(){
return countries;
}

public String getCountry(){
return country;
}

public void setCountry(String country){
this.country=country;
}

public String execute() throws Exception {
return SUCCESS;
}

but we couldnt populate those countries in drop-down list (using select tag).

When we execute we get blank page

and error log shown as follows :

SEVERE: Servlet.service() for servlet jsp threw exception
tag 'select', field 'list', name 'country': The requested list key 'countries' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]
at org.apache.struts2.components.Component.fieldError(Component.java:231)
at org.apache.struts2.components.Component.findValue(Component.java:293)
at org.apache.struts2.components.ListUIBean.evaluateExtraParams(ListUIBean.java:79)
at org.apache.struts2.components.Select.evaluateExtraParams(Select.java:99)
at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:780)
at org.apache.struts2.components.UIBean.end(UIBean.java:481)
at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:43)
at org.apache.jsp.vendor_005fsignup_jsp._jspx_meth_s_005fselect_005f1(vendor_005fsignup_jsp.java:370)
at org.apache.jsp.vendor_005fsignup_jsp._jspx_meth_s_005fform_005f0(vendor_005fsignup_jsp.java:172)
at org.apache.jsp.vendor_005fsignup_jsp._jspService(vendor_005fsignup_jsp.java:100)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:416)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)

Thanks again for your time and prompt reply,
Lakshman.
11 years ago
Sonny Gill,

Thank you for your quick response

As you had told, we have provided the "getCountries" method in the POJO class, as follows:

public List getCountries(){
return countries;
}

We had defined the tag of our '.jsp' as:

<s:select
tooltip="Choose Your Country"
label="Country"
list="countries"
name="country"
headerKey="None"
headerValue="None"/>

We had actually had a reference to the link, http://www.roseindia.net/struts/struts2/struts2uitags/select-tag.shtml, while attempting to implement this. But, unfortunately, the solution given in the link did not work for us.

Thanks again for your time and prompt reply,
Lakshman.


11 years ago
Hello people,

In our application, we have several list boxes having "fixed values". We have displayed them in our ".jsp" pages using tags defined as given below:

<s:select
tooltip="Choose Your Favourite Colour"
label="fav colour"
list="{'Red','Bue','Green'}"
name="fav_colour"
headerKey="None"
headerValue="None"/>

But there is a "list box", which needs to be populated with values from an "Array List". We have inserted values into the "Array List" as follows:

List countries = new ArrayList();
countries.add("India");
countries.add("United States");
countries.add("UK");


Now., we do not know how to make the values of this "Array List" appear in the appropriate list box in the ".jsp" page. The tag, as defined in the ".jsp" page, is as follows:

<s:select
tooltip="Choose Your Country"
label="Country"
list= ??? (This is where we need to substitute the names of the countries from the "Array List" defined above)
name="country"
headerKey="None"
headerValue="None"/>

Thanks for your time,
Lakshman.





11 years ago
[size=18] sorry james for late Reply


i am using "struts-2.0.14-all.zip" and i am trying this example.. my requirement is two select have to select at a same time . one is country and another one is cities, whenever we click the countries list related cities has to be populated . for eg :
if you select "U.S" country related cities in "U.S" has to be shown in another select box. i tried this example in javascript it's working but strut2 tag are entirely different that's why i am trying to use " doubleselect " Tag . is there any other way to select two populate two select box dynamically at a same time.




with Regards
Lakshman







11 years ago
hi David

Thanks for your Response


i tried for this example which is given in apache.strut2 document. Example is like this


<s:form>

<s:doubleselect label="doubleselect test2" name="menu" list="#{'fruit':'Nice Fruits', 'other':'Other Dishes'}" doubleName="dishes" doubleList="top == 'fruit' ? {'apple', 'orange'} : {'monkey', 'chicken'}" />


</s:form>
</body>
</html>


when i tried to execute this program it showing following error:

FreeMarker template error!

Expression parameters.formName is undefined on line 98, column 43 in template/simple/doubleselect.ftl.
The problematic instruction:
----------
==> ${parameters.formName} [on line 98, column 41 in template/simple/doubleselect.ftl]
in include "/${parameters.templateDir}/simple/doubleselect.ftl" [on line 25, column 1 in template/xhtml/doubleselect.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression parameters.formName is undefined on line 98, column 43 in template/simple/doubleselect.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.Expression.getStringValue(Expression.java:118)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.include(Environment.java:1378)
at freemarker.core.Include.accept(Include.java:155)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.process(Environment.java:176)
at freemarker.template.Template.process(Template.java:232)
at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:168)
at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:530)
at org.apache.struts2.components.UIBean.end(UIBean.java:484)
at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:43)
at org.apache.jsp.com_indium_mobitail.doubleselect_jsp._jspx_meth_s_005fdoubleselect_005f0(doubleselect_jsp.java:150)
at org.apache.jsp.com_indium_mobitail.doubleselect_jsp._jspx_meth_s_005fform_005f0(doubleselect_jsp.java:105)
at org.apache.jsp.com_indium_mobitail.doubleselect_jsp._jspService(doubleselect_jsp.java:69)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:416)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)


i included all neccessary jar files in lib folder but i didn't get it. please give any suggestion what this Error and how to solve it.






with Regards
Lakshman
11 years ago
hi everyone

hi i need to populate two select box at a same time using strut2. i used the tag callled " doubleselect" when i run the application the application it getting the problem " FreeMarker template error!" . could any body solved my problem.


otherwise give me the suggestion that two select box have to populate at a same time using strut2





Thanks for your Help










With Regards
Lakshman

11 years ago