Nadine Hossam

+ Follow
since Jun 19, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nadine Hossam


I'm having the same problem
Did you find a solution or a work around for that?
11 years ago
I'm using struts and tiles in my JSP and I need to have nested layouts.
I need to have the main Layout, and have this one contains body Layout.

The problem is that I can't pass this body value to the bodyLayout
<definition name="screen1" extends="LayoutDef">
<put name="body" value="/JSP/temp1.jsp" />

<definition name="screen2" extends="LayoutDef">
<put name="body" value="/JSP/temp2.jsp" />

Can anyone send me sample of code of how the tiles-config and layout files should look like?

16 years ago
I have developed a web application with tiles, using eclipse and tomcat as the app server.
And it's working fine.
Now I'm trying to move to websphere, I copied all the files but it's getting me this error

[7/26/07 16:16:24:172 AST] 45a28f4f WebGroup E SRVE0026E: [Servlet Error]-[Can't get definitions factory from context.]: javax.servlet.jsp.JspException: Can't get definitions factory from context.
at org.apache.struts.taglib.tiles.InsertTag.processDefinitionName(

Although it's working fine on tomcat.
I have put the struts-tiles.tld, struts.jar in the lib folder isnide WEB-INF. And added taglib definition in web.xml. And tiles-defs.xml. And added the tiles plugin in the trsuts-config file.

so I guess it's something related to the websphere itself as, Any help?
16 years ago
Hey all,
I found out what the problem is. It was in the validation.xml.
All you have to do is to replace
<arg key=""/>
<msg name="required" key=""/>

Didn't know the reason, perhaps it's a bug or something.

Any suggestions about how to specify whether I need it in popup msg or to be printed in the page?
16 years ago
I'm using the validator framework with struts, in order to validate the user data. And I wanted to get the error messages from the file. But instead it writes ???en_US.errors.required??? instead of fileds names

I don't think that there's a problem with my message resource file as the rest of the fields titles in the page are displayed properly from this property file

Here s my Form JSP
<html:form method="post" action="vfcLogin" onsubmit="return validateVFCLoginForm(this);">

<fmt:message key="" />
<html assword styleClass="inputText" property="pin" redisplay="false"/>

<html:submit styleClass="okBtn" ><fmt:message key="button.submit"/></html:submit>


<html:javascript formName="VFCLoginForm"/>

and my validation.xml
<form name="VFCLoginForm">
<field property="pin"
<arg key=""/>

and in my struts-config.xml

<form-bean name="VFCLoginForm"
type="com.bean.VFCLoginForm" />

<action path="/vfcLogin"
type="com.action.VFCLoginAction" name="VFCLoginForm"
scope="request" validate="true" input="/JSP/vfc.jsp">
<forward name="success" path="/JSP/vfc.jsp" />

<message-resources parameter="MessageResources" null="false" />

<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config"
value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
<set-property property="definitions-parser-validate"
value="true" />

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


and defined the message resource property file in my web.xml


So i really don't know where this error is coming from.
Any idea?

Another thing, how do I define whether do I want a popup msg to appear or just write the errors in the page?
currently this code is generating a popup msg with this error msg ???en_US.errors.required???
16 years ago
I'm developing a web application using Struts framework.

and my questions is, does the validate method int the ActionForm replaces the using javascript validation?

If I can do all the validations in this validate method, so does that mean that i'm not going to use JS at all?

For example if I need to check if a field has been entered, or for the field's length
Should I do that using JS validation, or the validate method in form bean.

if they are working the same way, so I guess it would be more efficient to be written in the ActionForm
[ July 22, 2007: Message edited by: Nadine Hossam ]
16 years ago
I would like to know whether is java too slow running on old hardware like 800mhz processors, based on real experience?
Also if any one can post articles regarding this topic, it'll be so useful.

17 years ago
I have a form in a JSP, this form has 2 combo boxes. the second combo box will be empty until the user choose a value from the first combobox.

so I have the select tag as follows in the jsp

<select name="country" id="firstBox" onchange="retreiveSecondList()">
<option value="" SELECTED>

and defined a js function

function retreiveSecondList(){
firstBox = document.getElementById('firstBox');
//Nothing selected

selectedOption = firstBox.options[firstBox.selectedIndex].value;

how can I send a request through this method having the selected index from the first combobox?

i have tried
req = new HttpServletRequest();"GET", url, true);

but it s not working!!!
anyone has any idea about that?
I used to make web projects using tomcat, and then i found that eclipse allows u to create Tomcat projects.

My question now is that, for the tomcat to see a web project it has to be placed in the webapps folder, but now using eclipse how will the tomcat see this project as it's not placed automatically inside its webapps?
i think there s a specific way to force the tomcat to refer to tomcat projects created from eclipse, right?
can anyone help me with that

thanks in advance
can anyone explain for me please if the HttpUrlConnection is used to make a requests to the HTTP server, so why do we have to use httpunit?

thanks in advance
18 years ago
I need to extact Months names out of a given string, I can do it easily using regular expressions

something like:

so that I can get the month's name found in this string but I need more professional code for doing so, I mean these months must be defined in the Date class but i dont know how to reach to them
any ideas?
18 years ago
I'm trying to convert a date written in a specific format into another different format using the DateFormat class.
I have this code but it's not working(it can't parse the given date and goes to the catch clause) and i dont know what s the reason, So if anyone has worked with that, can you tell me what s the problem

public static void main(String[] args) {
String dateString = "Nov 4, 2003 8:14 PM";
DateFormat format = SimpleDateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT);

// Parse the date
try {
Date date = format.parse(dateString);
System.out.println("Original string: " + dateString);
System.out.println("Parsed date : " + date.toString());
catch(ParseException pe) {
System.out.println("ERROR: could not parse date in string \"" +
dateString + "\"");

thanks in advance
18 years ago
hi all,
i have stored the cities' names in the database so that i can use these records in extracting cities from any given document.
what's the best way to do so?

1- The simplest way is to get each single record(city name) and check whether it exists in the document or not, but this will take a lot of time (looping through all the records, knowing that we have about 2000 city)

2- I thought of using regular expressions by placing all the cities in one regular expression like this (Anguilla|Vienna|Aberdeen|Boston|Egypt|Columbia....etc)
but as we said before it ll be too long regular expression that will take long time too

can anyone tell me what to do, what's the best solution in such cases