This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line!
See this thread for details.
Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!

Alok Pota

Ranch Hand
+ Follow
since Mar 07, 2001
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 Alok Pota

Great tool for doing RAD web app dev with JSF. However the time I save in
writing code I lose in waiting for the IDE to refresh. The IDE is a resource
hog and is extremely slow. I'm afraid I will have to pass on it until they
make it usable (speed wise). The features are great though.
14 years ago
JSF
<c:set var="tooltip" value="${bean.notes}" />
<c:set var="showtext" value="${fn:substring(bean.notes, 0, 60)}..." />

It turns out that fn:substring(bean.notes, 0, 60) mutates the String bean.notes so tooltip also ends up being truncated.

This is different behaviour from scriptlet code..

<%
String tooltip = bean.getNotes();
String showtext = bean.getNotes().substring(0, 60);
%>

In above tooltip will not be truncated (which is the expected behaviour).

Has anyone else seen this or its just a bug in the app server (Resin)?
14 years ago
JSP
What is the legal syntax for the expressions that can be used inthe valid when
validator.
14 years ago
Can a Struts ActionForward redirect to a page in another servlet context.

I know the re-direct works within the same servlet context.
14 years ago
How do I get the xml string representation of the of an org.w3c.dom.Document object?
I have two properties on a form (zip and country) and I would like to validate
a us-zip for country = 'USA' and canadian zip when the country is 'Canada'
How would one go about doing this using validwhen when I have the following
in my validation.xml

validator-custom-rules.xml..

<form-validation>
<global>
<!-- Zip -->
<constant>
<constant-name>us_zip</constant-name>
<constant-value>^\d{5}((-|\s)?\d{4})?$</constant-value>
</constant>
<constant>
<constant-name>canada_zip</constant-name>
<constant-value>[A-Z]\d[A-Z] \d[A-Z]\d</constant-value>
</constant>
</form-validation>


validation.xml...

<field property="zipcode" depends="validwhen, mask" page="1">
<arg0 key="Zip code" resource="false" />
<var>
<var-name>mask</var-name>
<var-value>${us_zip}</var-value>
</var>
<var>
<var-name>test</var-name>
<var-value>(country == "USA") and (*this* != null)))</var-value>
</var>
</field>

<field property="country" depends="mask, maxlength" page="1">
<arg0 key="Country" resource="false" />
</field>




Is it possible to add multiple tests to the validwhen validator
14 years ago
Is there a convenient way to iterate over the errored properties. The default
implementation of <html:errors> just dumps all the errors (without even seperating them with a newline). I want to show all the errors
in one place.
14 years ago
1. How do I make changes made to page using DHTML/JS apply to the bean (i.e.
if I were to add a row of <input type="text"> using DHTML and instead of calling an addRow() method on the bean. How do I get JSF to recognize that new row?

2. <h:commandButton id="submitAdd" action="#{CalcBean.addValue()}" value="Add Even Values" />

Can I pass arguments to addValue(..)???

3. I have the following object tree.

class Bean {
PurchaseOrder po;
}

class PurchaseOrder {
List<LineItem> lineItems
}

class LineItem {
String type
float price;
}

I want to show a list of textboxes of lineitems of only certain type.

<h ataTable id="items" value="#{bean.po.lineItems}"
var="lineItem"
>
<h:column>
<h:inputText id="custom" value="#{lineItem.price}" required="true"/>
</h:column>
</h ataTable>


However the above will show all lineItems, I only want of a particular type.. basically I am looking for a alterative to the #{bean.po.lineItems} JSF EL expression.
14 years ago
JSF
Is there a good reference on the available syntax for JSF EL?
14 years ago
JSF
How do I specify a module specific strutserror.properties
file?
14 years ago
Doesn't the servlet spec require that getParameterNames() return an enumeration that reflects the order of the parameters on the page that was submitted?

The app server that I am using is not returning the parameter names in the order in which they are defined in the page. Not sure if this is a vendor bug.
14 years ago
Thats...

class CustomPropertyConfig extends FormPropertyConfig {
private String xPath;
public String getXPath() { return xPath; }
public void setXPath(String s) { xPath = s; }
}
14 years ago
The struts-config_1_2.dtd indicates that one can have a custom class that
extends FormPropertyConfig for getting properties. However it looks like one
add custom attributes to the tag that is used to indicate form properties
however

<form-property xPath="zzz" className="CustomPropertyConfig" name="yyy" type="java.lang.String" />


class CustomPropertyConfig {
private String xPath;
public String getXPath() { return xPath; }
public void setXPath(String s) { xPath = s; }
}

However getXPath() always returns null. So is there a way to add custom
atributes to this tag which struts will recognize. Currently it silently ignores (Struts 1.2).
14 years ago
Is there anything like Struts like modules in JSF?. Preferably, I would like
to be able to add modules dynamically without modifying the core web.xml. (I know Struts does not provide this out of the box, but we have a custom ActionServlet that does the dynamic module loading)
14 years ago
JSF
On a page with a form on it, I have two submit buttons, one button does not validate the form and the other button does. Is it possible to simulate this?
14 years ago