Yasir Bajwa

Greenhorn
+ Follow
since May 02, 2007
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 Yasir Bajwa

I copied these jars to WEB-INF/lib:

commons-beanutils-1.8.0.jar
commons-digester-1.8.1.jar
commons-logging-api-1.1.jar
tiles-api-2.1.2.jar
tiles-compat-2.1.2.jar
tiles-core-2.1.2.jar
tiles-jsp-2.1.2.jar
tiles-portlet-2.1.2.jar
tiles-servlet-2.1.2.jar

I downloaded tomcat 6.0.18, and eclipse 3.4.1. I added the tomcat server and created a dynamic web project.

I was able to get a generic 'hello world' application working, but it seems that the jars copied to WEB-INF/lib aren't picked up, or there is something else I messed up, but I'm not sure where to start.

Thanks for helping
13 years ago
Hello

I have followed the instructions here:

http://cwiki.apache.org/TILES/using-tiles-framework-without-struts2.html

I used Tomcat 6.0, and I've checked several times that I've followed the instructions and copied the correct jars, but no luck

Has anyone faced a similar problem, i've been at this for hours, any help appreciated, thanks

the error:

Parent -> java.net.URLClassLoader@48f675
org.apache.tiles.web.startup.TilesServlet
java.lang.ClassNotFoundException: org.apache.tiles.web.startup.TilesServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1498)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1109)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1007)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4808)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5196)
at com.sun.enterprise.web.WebModule.start(WebModule.java:326)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:973)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:957)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1584)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1222)
at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:182)
at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:278)
at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:974)
at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:961)
at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:464)
at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:176)
at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:226)
at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
13 years ago
I had a similar problem .. i had to display 10000 records, so I built a 'scrolling table' control. I used tables as 'pages', so I would set a page size (e.g. 25 rows) and return a table containing it. The control just appends a bunch of tables together, but to the user it looks like one table. it fetches 'pages' based on scroll position.
I've tried using AJAX with JSF, and also with JSF 1.0 since I'm stuck with it .. its standard where i'm working

I've ended up adding a filter to synchronize session requests, as concurrent 'ajax' requests (or any concurrent http requests) caused problems with the jsf implemenation updating the component tree

hope that helps
14 years ago
JSF
You might want to also take a look a print style sheets. Those would be CSS styles applied only for printing, they would be visible to the user in the print preview, and of course printed result
Hard to say what's going on there but instead of

alert(resXML);// This returns OBJECT

Try to also look at the responseText property (req.responseText)to see the text that is coming back.

You might also want to try firefox and download the firebug plugin. You can then set break points and step through the code to inspect values.
<h:selectOneRadio value="#{myBean.myBooleanOption">
<f:selectItem itemValue="#{true}" itemLabel="Yes" />
<f:selectItem itemValue="#{false}" itemLabel="No" />
</h:selectOneRadio>

Missing closing brace for myBean.myBooleanOption

Use just "true", "false" as item values
14 years ago
JSF
anyone?

I was thinking of adding a servlet filter with code something like this.

HttpSession = request.getSession();
synchronized(session) {
chain.doFilter(req,resp);
}

Each request from the same session would be forced to wait ... i think

My app is running in a single JVM. I'm assuming the overhead is setting up and taking down the synchronization, and that it doesn't matter (at least in this case) that I'm in that block for the entire request?
14 years ago
JSF
haven't tested it, try

<h:outputText value="#{myBean.myBooleanProperty ? 'Yes' : 'No'}" />
14 years ago
JSF
instead of:
<h:inputText id="Firstname" value="" required="true">
<f:validator validatorId="validation" value="Firstname"/>
<f:attribute name="field" value="Firstname" />
</h:inputText>

try:
<h:inputText id="Firstname" value="******" required="true">
<f:validator validatorId="validation" />
</h:inputText>

replace ****** with the bean / property expression you want to set

You could also just use a function call to do the validation method instead of registering a validator
14 years ago
JSF
h:outputText is for just that, text output, but keep in mind this will output text for html by default so it escapes characters as needed

h:outputLabel is intented to act as a label, for example, with an h:inputText control -- example
<h:outputLabel for="myinputid">Label Text:</h:outputLabel>
<h:inputText id="myinputid" value="#{mybean.property}" />

would generate html something like:

<label for="myinputid">Label Text:</label>
<input id="myinputid" type="text" name="myinputid" />
14 years ago
JSF
Not sure, but it doesn't look like the Validator interface is actually implemented. How is it compiling?

In your case with method calls I don't think you need to actually implement the Validator interface, but the validation methods should have methods with the same signature as the validate method in the Validate interface.

The validateDate method doesn't look quite right, I think java.text.ParseException is a checked exception, so it probably won't work as a validator method. I guess you could wrap any checked exception into a validator exception?
14 years ago
JSF
Hi,

I have a managed bean configured something like this:

<managed-bean>
<managed-bean-name>formBean</managed-bean-name>
<managed-bean-class>com.example.Form</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>queryBean</managed-bean-name>
<managed-bean-class>com.example.Query</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>form</property-name>
<value>#{formBean}</value>
</managed-property>
</managed-bean>

It works fine in that the queryBean is passed the formBean when access in jsf/jsp page. Within the query class, I access the formBean, but I guess since formBean is in the session scope its possible the user could submit another request and write to the bean while I am reading it. I can synchronize the session, but that seems to defeat the purpose of the managed bean since it defines the scope, and if it changed I would have to update the code as well.

Is there some way to determine the scope of the managed bean through some api, or, perhaps there is a way to synchronize client requests per session with a filter? Is there some standard way of doing that? Thanks
14 years ago
JSF
I have a jsp page with an h:outputText similar to this:

<h:outputText rendered="#{myBean.property}"
value="A text value" />

It works fine when the page is displayed. It is possible to submit another form from within this page. When a form is submitted from with the page, the rendered attribute is evaluated again. I don't understand why this would be necesseary for outputText element. I was assuming also that when a form is submitted the jsf framework would only try to update the component values that were referenced in the form.

Can someone clarify how this is supposed to work? Thanks
14 years ago
JSF
This is really problematic, as a big part of the design of JSF seemed to be protecting model integrity.

There must be some failsafe built-in to the framework to prevent users from corrupting model integrity via multiple tabs/windows?
15 years ago
JSF