Alex Kovalchuk

Greenhorn
+ Follow
since Oct 20, 2004
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 Alex Kovalchuk

I guess your question might be the better one. Along with the "what" would be:

When would I want to use JSF or AJAX in an environment like Yahoo?

Excuse my ignorance... I guess I am looking for that selling point. As a developer, we have many tools and avenues to accomplish our task. I haven't had any real exposure to see a need to use AJAX or JSF or Java for webpages on a smaller scale. I think some of it comes from not writing a small "useable" model. Like say a Pet store or something like a "file cabinet" application of storing newsletters, etc.
17 years ago
JSF
Keeping it simple...

Say I use both ort one of them. And I have a website with someone like Y@hoo who is hosting it. And everything drives from that site which has MYSQL, PHP, Perl, HTML/XHTML and CSS support.

Would JSF and AJAX fit into an environment like that to be useful? :roll:
17 years ago
JSF
I have read the Amazon dot com Editoral Reviews.

I had thought about loading JBoss on my PC at home. Thinking it might be helpful for developing use with web pages.

My dumb questions are;
Would this be helpful if I were to develop webpages for potential clients?
Are there any special considerations I might need to help make this decision?
Do you have a check list to help make a choice for using JBoss verses what it is qould replace or enhance?

Thanks,
Alex :roll:
18 years ago

Originally posted by Thomas Paul:
yes, that will cause the exception you encountered. You can have the struts.jar in your ext directory but you still must have it in the WEB-INF/lib directory. On my own setup that is how I have it so I can do compiles easily.

[ March 17, 2003: Message edited by: Thomas Paul ]



I also sent Barry this email and he replied that he had not worked with this in a long time;

On this web page you made a reference;

https://coderanch.com/t/46371/Struts/struts-installation

On this line of;

quote:
--------------------------------------------------------------------------------
The structure should be c:\tomcat\webapps\struts\jsp and c:\tomcat\webapps\struts\WEB-INF. Right?

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



I have;
WebSphere Studio Application Developer (Windows) Version: 5.1.2
using Apache Tomcat Support 5.1.1
Struts Tools 5.1.2

I have the information laid out like the previous posts talk about. Except I do not have tomcat laid out in the folder order you mentioned. I just added CVS Repository to my PC. That seems to have been when this started.

Do you have a list suggestion of what needs to be laid out in what order with my config?

Thanks in advance,
Alex
19 years ago
Let me make a small correction. I am using LDAP security.
19 years ago
The welcome page is successful. The login is successful. etc...

More to the point. How would I check in the JSP (at the Welcome page) if the user had logged in?

Or would you check it that way?

I've been struggling with this.

The environment contains WSAD 5.1.2, jsp, struts.

Thanks,
Alex
19 years ago
If you were setting up jsp's and Action Classes... where would you set up the "Locale" that denotes what language that you are using for the session and possibly changing it during the session. With the ability of the jsp being able to read it back.

Quite simply... say you sign in using Spanish... you are working along and you want to show a co-worker/client what you have and switch it over to English. You are done with your coworker/client and switch it back to spanish and continue your work. Or you could do it the other way around.

How would you accomplish this? I am trying to keep it simple by managing the "words/phrases" in PropertyResource files. What I am using is WebSphere Studio Application Developer (Windows) 5.1.2 and Struts tag libs.

Thanks,
Alex
19 years ago
P.S. I was trying to look in the welcome page to see if I already assigned a language to it... if I did then I could redirect it to the main menu page. But... as I said... I am getting nulls back from the Locale.

Thanks again,
Alex
19 years ago
I am creating a test to allow you to sign in and get a welcome page (jsp) that will ask if you with to Navigate (via a link) in English or Spanish (kinda like an ATM). Then it will go to the login form page (jsp) for (drop down) name and password. And it should go to the main menu (jsp) page. That is where it is not going. It goes back to the welcome page.

Here are the jsps;
---------
Welcome page (index.jsp) (trying to drag out the LOCALE I am getting a null value)
---------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<html:html locale="true">
<% String locale = (String)session.getAttribute("org.apache.struts.action.Action.LOCALE_KEY, local"); %>
<HEAD>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE><bean:message key="index.title"/></TITLE>
<html:base/>
</HEAD>
<body bgcolor="#FCFBCD">
<h3><bean:message key="index.heading"/></h3>
<ul>
<li>
<html:link page="/AppSO.jsp?language=english">
<bean:message key="index.logon.english"/>
</html:link>
<li>
<html:link page="/AppSO.jsp?language=spanish">
<bean:message key="index.logon.spanish"/>
</html:link>
</li>
</ul>
<p> </p>
</body>
</html:html>
-----------
login jsp (AppSO.jsp)
-----------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html:html locale="true">
<% if( request.getParameter("language") == null )
{
request.getRequestDispatcher("index.jsp").forward(request, response);
}

// language == "english" or language == "spanish" - so set the locale....
// do the same thing as the setLocale() method in the Action class
// LOCALE_KEY
String language = request.getParameter("language");
java.util.Locale locale = null;

if (language.equals("english"))
{
locale = java.util.Locale.ENGLISH;
}
else if (language.equals("spanish"))
{
locale = new java.util.Locale("es","ES");
}

session.setAttribute(org.apache.struts.action.Action.LOCALE_KEY, locale);
%>
<head>
<!--
This is JAVA code that gets the individual data elements
from the UI Bean that are to be used by this page to
access all dynamic data. -->
<TITLE><bean:message key="logon.title"/></TITLE>
<script language="JavaScript" type="text/JavaScript">
function validate(form)
{
dataIsOK = true
if (form.j_username == null || form.j_username.value == null || form.j_username.value == "1")
{
window.alert("Please select an Area Office/Seleccione por favor una oficina del �rea")
dataIsOK = false
}

if (form.j_password == null || form.j_password.value == null || form.j_password.value == "")
{
window.alert("You must enter a password/Usted debe incorporar una contrase�a")
dataIsOK = false
}

return dataIsOK
}
</script>
</head>
<BODY bgcolor="#FFFFFF">
<TABLE BORDER="0" align="center" width="750">
<TR>
<TD>
<script type="text/javascript">
var d = new Date()
var time = d.getHours()
if (time < 10)
{
document.write("<b>Good morning/Buenos d�as</b>")
}
else
{
document.write("<b>Good day/Buonas d�az</b>")
}
</script>
<br>

<%if ( null != request.getParameter("error") )
{%>
<b>*</b>
<%}%>
<%if ( null == request.getParameter("error") )
{%>
<b>Guest/Hu�sped</b>
<%}%>
<%if (request.getParameter("error") != null) {%>
<CENTER><B><FONT COLOR="RED">
<bean:message key="prompt.errorname"/>
</FONT></B></CENTER>
<%}%>
<h2 align="center">
<font face="Arial, Helvetica, sans-serif">
<bean:message key="prompt.regionlogin"/>
</font></h2>
<p align="center"><b> </b>
<b> </b><font color=#8B008B><big>
***
<bean:message key="prompt.signonmessage"/>
***
</big> </font><br>
<font face="Arial, Helvetica, sans-serif"><br>
<br>
</font>

<form action="j_security_check" method="POST" onSubmit="return validate(this)">

<table width="100%" border="2" cellpadding="3" cellspacing="0" bordercolor="#284E9B">
<tr>
<td><br>
<table width="74%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top" width="5%">
<font face="Arial, Helvetica, sans-serif"> </font>
</td>
<td width="32%" valign="top">
<font face="Arial, Helvetica, sans-serif">
<bean:message key="prompt.region"/>
</font></td>
<td width="63%">
<p>
<SELECT NAME="j_username" SIZE="1">
<OPTION VALUE="0"><bean:message key="prompt.selectone"/>
<OPTION VALUE="TEST1"><bean:message key="prompt.north"/>
<OPTION VALUE="TEST2"><bean:message key="prompt.south"/>
<OPTION VALUE="TEST3"><bean:message key="prompt.northeast"/>
<OPTION VALUE="TEST4"><bean:message key="prompt.southcentral"/>
<OPTION VALUE="TEST5"><bean:message key="prompt.southeast"/>
<OPTION VALUE="TEST6"><bean:message key="prompt.west"/>
<OPTION VALUE="TEST7"><bean:message key="prompt.east"/>
</SELECT> <br>
</td>
</tr>
<tr>
<td valign="top" width="5%">
<font face="Arial, Helvetica, sans-serif"> </font>
</td>
<td width="32%" valign="top">
<font face="Arial, Helvetica, sans-serif">
<bean:message key="prompt.password"/>
</font></td>
<td width="63%">
<font face="Arial, Helvetica, sans-serif">
<INPUT TYPE=password NAME="j_password" SIZE=10 MAXLENGTH=10 VALUE="">

</font></td>
</tr>
<tr>
<td valign="top" width="5%"> </td>
<td width="32%"> </td>
<td width="63%"> </td>
</tr>
<tr>
<td valign="top" width="5%">
<font face="Arial, Helvetica, sans-serif">
</font></td>
<td width="32%">
<font face="Arial, Helvetica, sans-serif">
</font>
<!--
<table border="0">
<tr>
<th></th>
<th><font face="Arial, Helvetica, sans-serif"></font></th>
</tr>
<tr>
<td>
<font face="Arial, Helvetica, sans-serif">
<input type=RADIO name="CURRENT_APPS_INDEX" value="1" CHECKED>
</font></td>
<td align="left">
<font face="Arial, Helvetica, sans-serif">
<bean:message key="prompt.currentapplications"/>
</font></td>
</tr>
<tr>
<td>
<font face="Arial, Helvetica, sans-serif">
<input type=RADIO name="CURRENT_APPS_INDEX" value="2">
</font></td>
<td align="left">
<font face="Arial, Helvetica, sans-serif">
<bean:message key="prompt.allapplications"/>
</font></td>
</tr>
</table> -->
<font face="Arial, Helvetica, sans-serif">
</font></td>
<td width="63%"> </td>
</tr>
<tr>
<td valign="top" width="5%">
<font face="Arial, Helvetica, sans-serif">
</font></td>
<td width="32%">
<font face="Arial, Helvetica, sans-serif">
</font></td>
<td width="63%"> </td>
</tr>
<tr>
<td valign="top" colspan="3">
<div align="center">
<input type=SUBMIT name="LOGIN_BUTTON" value=<bean:messagekey="logon.login"/> class="buttonstyle">
</div>
</td>
</tr></table>
<br>
</td>
</tr>
</table>
<br>

</form>
</TD>
</TR>
</TABLE>
</BODY>
</html:html>
------------------------
Need more info??
Thanks in advance,
Alex
19 years ago
I think I got an answer to this. But I am trying to work out a different problem that I will post seperate from this. Then I can come back to this issues and see if it is right.

The answer was to create a Dispatch Action Class. Using the key information in the ApplicationResource folders rather than the value i.e.;

prompt.Name

= Nombre
not the value of

prompt.Name

but the key itself. As the key is the same in both ApplicationResource files.

Thanks for at least looking at this,
Alex :roll:
19 years ago
P.S. We are using WebSphere Studio Application Developer (Windows) Version: 5.1.2
19 years ago
First post...

I sure hope this is an easy question.

How can you develope in a Java Action Class to grab information that you have coded (from the jsp), such as;

<INPUT TYPE=SUBMIT NAME="BUTTON"
VALUE=<bean:message key="mainMenu.date"/> class="buttonstyle">

to find out what the Value is?

Especially if you are using two different Application.Resource files (English and Spanish).

Thanks,
Alex
19 years ago