Anoop V. Kumar

Greenhorn
+ Follow
since Jan 21, 2006
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 Anoop V. Kumar

Please join this group:
http://groups.google.com/group/sql-users

This is a group for users of general sql. The sql logic and syntax discussed will not necessarily be tied to any particular product, but will encompass (and not be restricted) to pl/sql (oracle), T-sql (Sql server), stored procedures, mysql, db2, postgresql, firebird, hsqldb, teradata etc..

http://groups.google.com/group/sql-users
14 years ago
Are you using some sort of datascroller?/ And in spite of that you run into memory issues??

Have you tried your database's pagination options - I know Oracle has one.

Anoop
16 years ago
JSF
Reposting the code as code:

16 years ago
JSF
Hello,

Has somebody successfully used the datascroller component from Tomahawk? I need help in that.

Basically, I have implemented it and it works great in the initial display - all the links appear (first, last, next, before and page numbers) - but when I click on the links I get this error:

****************************
An Error has occurred in this application.

javax.servlet.ServletException
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:129)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:831)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:652)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1203)
at java.lang.Thread.run(Unknown Source)
****************************
****************************


Here is the JSF code:
********************************************************

<h anelGroup>
<t ataTable id="data"
var="system"
value="#{systemBean.systems}"
preserveDataModel="true"
rows="10">

<h:column>
<f:facet name="header">
<h utputText value="#{bundle.systemLabel}" />
</f:facet>
<h utputText value="#{system.name}" />
</h:column>

<h:column>
<f:facet name="header">
<h utputText value="#{bundle.systemCode}" />
</f:facet>
<h utputText value="#{system.ataCode}" />
</h:column>

<h:column>
<f:facet name="header">
<h utputText value="#{bundle.subSystemsLabel}"/>
</f:facet>
<h:commandButton
value="#{bundle.subSystemsButton}"
action="subsystems">
</h:commandButton>
</h:column>

</t ataTable>

<h anelGrid columns="1">
<t ataScroller id="scroll_1"
for="data"
fastStep="10"
pageCountVar="pageCount"
pageIndexVar="pageIndex"
paginator="true"
paginatorMaxPages="9">
<f:facet name="first" >
<t utputText value="first"/>
</f:facet>
<f:facet name="last">
<t utputText value="last"/>
</f:facet>
<f:facet name="previous">
<t utputText value="previous"/>
</f:facet>
<f:facet name="next">
<t utputText value="next"/>
</f:facet>
</t ataScroller>
</h anelGrid>
</h anelGroup>
********************************************************


I have read somewhere that we need to write some code to actually make it work - but so far I have searched on google and on the wiki sites of myfaces.org and have not found the actual literature regarding this implementation.

Please let me know if there is such an explanation and do forward me the link or provide some pointers on what methods to implement / configuration.

Thanks,
Anoop
16 years ago
JSF
Hi all,

I am trying to run my JSF web-application on Resin 3.0.17. The same application runs fine in Tomcat 4.x and 5.x and I am not using anything fancy. But during deploying (that is after dropping the war and starting resin) I keep getting these errors:

[23:41:46.866] javax.servlet.ServletException: java.lang.IllegalStateException: No Factories configured for this Application - typically this is because a context listener is not setup in your web.xml.
[23:41: 46.866] A typical config looks like this;
[23:41:46.866] <listener>
[23:41:46.866] <listener-class>net.sourceforge.myfaces.webapp.StartupServletContextListener</listener-class>
[23:41:46.866] </listener>
[23:41:46.866]
[23:41:46.866] at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:632)
[23:41:46.866] at com.caucho.server.dispatch.ServletManager.init(ServletManager.java:152)
[23:41:46.866] at com.caucho.server.webapp.Application.start(Application.java:1599)
[23:41:46.866] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:579)
[23:41:46.866] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit (StartAutoRedeployAutoStrategy.java:72)
[23:41:46.866] at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:467)
[23:41:46.866] at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java :152)
[23:41:46.866] at com.caucho.server.webapp.ApplicationContainer.start(ApplicationContainer.java:634)
[23:41:46.866] at com.caucho.server.host.Host.start(Host.java:385)
[23:41:46.866] at com.caucho.server.deploy.DeployController.startImpl (DeployController.java:579)
[23:41:46.866] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
[23:41:46.866] at com.caucho.server.deploy.DeployController.startOnInit (DeployController.java:467)
[23:41:46.866] at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:152)
[23:41:46.866] at com.caucho.server.host.HostContainer.start(HostContainer.java:467)
[23:41: 46.866] at com.caucho.server.resin.ServletServer.start(ServletServer.java:909)
[23:41:46.866] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:579)
[23:41:46.866] at com.caucho.server.deploy.AbstractDeployControllerStrategy.start (AbstractDeployControllerStrategy.java:56)
[23:41:46.866] at com.caucho.server.deploy.DeployController.start(DeployController.java:475)
[23:41:46.866] at com.caucho.server.resin.ResinServer.start(ResinServer.java:475)
[23:41:46.866] at com.caucho.server.resin.Resin.init(Resin.java)
[23:41:46.866] at com.caucho.server.resin.Resin.main(Resin.java:614)

The error seems to say that my web.xml does not have the required context-listener setup - but I have double-checked it and the web.xml does contain the listener setup exactly as shown:

Here is my web.xml in the war:
<!--*************************************-->
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd " version="2.4">

<display-name>GSE</display-name>

<!-- Define the basename for a resource bundle for I18N -->

<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>

<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener </listener-class>
</listener>

<listener>
<listener-class>net.sourceforge.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>


<servlet>
<servlet-name>faces</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>

<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>

</web-app>
<!--*************************************-->

Has anybody got JSF to run on Resin 3.x before?? I will really appreciate if anyone can let me know how I can resolve this issue.
--
Thanks and best regards,
Anoop
16 years ago
JSF
Never mind - thanks..

I figured out that I had rendered=#{values} where values were returning Lists - I think they can only return boolean or Strings here..

Anoop
16 years ago
JSF
I am getting this error and no further info. Also there is no error on the console nly on the browser - I have been trying to troubleshoot for a whole day with little success...

It happens when I click on a button to go to the next page. If anybody has even a clue of why this error occurs, please let me know..



Thanks,
Anoop
16 years ago
JSF
That can easily be done using Javascript - check out this code at equinox.dev.java.net:

<%-- Step 2. Create a dummy actionLink, w/ no value --%>
<h:commandLink action="#{userForm.edit}" id="editUserLink">
<f aram name="id"/>
</h:commandLink>
<%-- Step 3. Write your own JavaScript function that's easy to call --%>
<script type="text/javascript">
function viewUser(id) {
var f = document.forms['editUser'];
f.elements['editUser:_link_hidden_'].value='editUser:editUserLink';
f.elements['id'].value=id;
f.submit();
}
highlightTableRows("userList");
</script>

Hope that helps,
Anoop Kumar V.
16 years ago
JSF
I have implemented a SelectOneMenu which displays some ids as the label and the value contained are actual objects that I have created. The objects are my business objects and non-string. It works fine.

Now I wanted to include the first item in the SelectOneMenu as: "Choose one" with a null or "" value - but I get NullPointerException.

Here is the jsp:

<h:selectOneMenu id="selectedModel"
value="#{modelBean.selectedModel}"
converter="#{modelBean.convert}"
onchange="this.form.submit();"
>
<f:selectItem itemLabel="Choose a model" itemValue=""/>
<f:selectItems value="#{modelBean.models}" />
</h:selectOneMenu>

I have made changes in my converter to return a null Model object if the value is "". (this was after I started getting ClassCastExceptions) But still doesnt work.

Also - in my logs I see that it is calling my converter's getAsString - should it not be calling the getAsObject method??

Has anybody managed to include a null value in a selectOneMenu which takes actual objects for the values?? Please let me know how you have done it

Thanks,
Anoop
16 years ago
JSF
I am using displayTag for pagination - inspired by the application hosted on equinox.
The pagination displays perfectly fine when the first request in made, bur when I click on any of the additional links to proceed to the next page etc.. I get an 404 error...

Here is the code which I have in the jsp:




I have also tried browse.jsp (the actual name) but even that gives the same error - 404.
Has anyone used displayTag before?? Can someone please help me resolve this...
If this doesnt work then I guess I will have to explore myfaces pagination options...

Thanks,
Anoop
16 years ago
JSF
Can you further help me with one thing that I am struggling...

I have a page (call it page1 using the backing bean bb1) where a user selects a value. Now I need to send the user to page2 (using bb2) AND I need to send the value that the user selected to the bb2... how can I do that..

Basically my question now is how do I send data from a jsp page to a backing bean that the jsp page does not use??

Thanks,
Anoop
16 years ago
JSF
Thanks a TON Sergey... Phew - I never knew this place existed - it is like a treasure house - I am hoping to implement almost every thing that is discusssed in the faq - Thanks again...

-Anoop
16 years ago
JSF
Ok - I figured out the answer to this issue of mine - I need to use converters because I am using application specific objects..

Thanks,
Anoop
16 years ago
JSF
I have a simple application with 3 pages and there is a backing bean for each page say page1-bb1, page2-bb2 and page3-bb3.

The value selected in page1 by the user is actually the input to displaying results in the page2 and again value from page2 is inout to page3. My question is what is the best way to pass these values/data between page1 and bean2 and page2 and bean3??

Is it really necessary that all managed beans for this application to work are in session scope?

Thanks in advance,
Anoop
16 years ago
JSF
Hi All,

I have been reading a lot about drop-down boxes in JSF. Most of them have been very useful but have not been able to completely solve my problem here...

I have a very simple page that displays a dropdown with model-id numbers. There is also a button below the dropdown which when clicked takes the user to another page and says "You selected this model: <model-id number from dropdown>"

So far so good - all works fine. Now I wanted to add a description so that after clicking on the button I get the modelId as well as the model description - This just does not work - the page does not even come up and shows a lot of errors.

In order to show the description as well I used the SelectItem constructor that accepts a value and a label. I used the modelId as the label and the model-description as value.

Here is the jsp page code:



Here is the java backing bean code:
This code is supposed to put the modelDescription as well - but does not work....


I get these errors:
On the browser:


javax.faces.el.EvaluationException: Expression: '#{modelBean.models}'
at net.sourceforge.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:463)
at javax.faces.component.UISelectItems.getValue(UISelectItems.java:55)
at net.sourceforge.myfaces.renderkit.RendererUtils.internalGetSelectItemList(RendererUtils.java:357)
at net.sourceforge.myfaces.renderkit.RendererUtils.getSelectItemList(RendererUtils.java:300)
at net.sourceforge.myfaces.renderkit.html.HtmlRendererUtils.internalRenderSelect(HtmlRendererUtils.java:369)
at net.sourceforge.myfaces.renderkit.html.HtmlRendererUtils.renderMenu(HtmlRendererUtils.java:328)
at net.sourceforge.myfaces.renderkit.html.HtmlMenuRendererBase.encodeEnd(HtmlMenuRendererBase.java:64)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:329)
at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:376)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:280)
at org.apache.jsp.gse.model_jsp._jspx_meth_h_selectOneMenu_0(org.apache.jsp.gse.model_jsp:306)
at org.apache.jsp.gse.model_jsp._jspx_meth_h_form_0(org.apache.jsp.gse.model_jsp:183)
at org.apache.jsp.gse.model_jsp._jspx_meth_f_view_0(org.apache.jsp.gse.model_jsp:147)
at org.apache.jsp.gse.model_jsp._jspService(org.apache.jsp.gse.model_jsp:92)
Caused by: javax.faces.el.EvaluationException: Bean: com.sigma.gse.view.ModelPageBean, property: models
at net.sourceforge.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:458)
at net.sourceforge.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:113)
at net.sourceforge.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:541)
at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
at net.sourceforge.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:438)
... 56 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sourceforge.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:454)
... 60 more
Caused by: java.lang.NullPointerException: value
at javax.faces.model.SelectItem.(SelectItem.java:55)
at com.sigma.gse.view.ModelPageBean.getModels(ModelPageBean.java:48)
... 65 more



On the Tomcat console:
ERROR - PropertyResolverImpl.getValue(117) | com.sigma.gse.view.ModelPageBean
javax.faces.el.EvaluationException: Bean: com.sigma.gse.view.ModelPageBean, property: models
at net.sourceforge.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:4
at net.sourceforge.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:113)
at net.sourceforge.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java


Code that worked:



I need help in figuring out what I am doing wrong? If you notice, there is very little difference between the code that worked and the above defective code.

Thanks a TON in advance,
Anoop
16 years ago
JSF