Struts 1.2.x and File I/O

2009-12-23 Thread davargas123

Is it necessary to upload a file to the server to process it in Struts, or
does it have access to the local file system? I was getting errors in my
code when it was attempting to use the file from my local machine, but if I
upload it to the server first and use the file from the server, it works
okay. That led me to wonder if it was just me messing up the code, or Struts
only seeing the directories on the server on which it is installed, and
that's what I want to know.

Thanks,
Dan
-- 
View this message in context: 
http://old.nabble.com/Struts-1.2.x-and-File-I-O-tp26903855p26903855.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



File I/O in Struts 1.2.x

2009-12-14 Thread davargas123

Is it possible to upload a file to a server, process the data as it needs to
be, and then write the file back to the local machine from which it
originally was uploaded all in a single execute method of a single action
class? Or, am I required to have an action for uploading it to the server,
and another for processing, and another for downloading, or something in
between?
-- 
View this message in context: 
http://old.nabble.com/File-I-O-in-Struts-1.2.x-tp26779909p26779909.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Simple two button form - Struts 1.2.x

2009-12-09 Thread davargas123

I am putting in page that loads at the beginning of my application, and all
it has two buttons that should end up forwarding to do one of two different
actions. How can I distinguish between which button has been pushed inside
the Action class so that I can forward it to the correct page? The JSP and
Action are as follows, so far:


JSP: 

<%...@taglib uri="/taglib/struts-html" prefix="html"%>
<%...@taglib uri="/taglib/struts-bean" prefix="bean"%>







 


 




Java class:

public class SSNChooseAction extends Action{

private static final Logger log =
Logger.getLogger(SSNChooseAction.class.getName());

public ActionForward execute( ActionMapping mapping, ActionForm form,
HttpServletRequest request,

HttpServletResponse  response){

ActionForward fwd = null;

if(){
fwd = mapping.findForward("single");
}else{
fwd = mapping.findForward("batch");
}


return fwd;
}

}

-- 
View this message in context: 
http://old.nabble.com/Simple-two-button-form---Struts-1.2.x-tp26716992p26716992.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts HTML taglib vs. Standard HTML tags

2009-12-06 Thread davargas123

I did check those to see if they had anything to do with it, but those aren't
the problem. I literally copied them straight from another page in the same
web app that I'm adding my page to. The page I'm doing is part of a larger
web app that already has a number of jsp pages which include struts tags and
work perfectly fine, but when I use the tags I totally lose all of the
rendering. It's very odd, and I don't understand how I'm running into this
problem based on what I've been reading about how to make your jsp pages and
use strugs tags.



Paul Benedict-2 wrote:
> 
> Did you check your server logs? I bet the problem is the taglib uri.
> 
> See the TLD URIs section:
> http://wiki.apache.org/struts/StrutsUpgradeNotes12to13
> 
> Paul
> 
> On 12/4/2009 1:41 PM, davargas123 wrote:
>>
>> When I change the standard HTML tags of my .jsp page into the Struts
>> tags,
>> the page loads up completely blank, aside from what is loaded by the
>> tiles-def. What could be causing this? I'm thinking that's why my page
>> doesn't submit data to the actionform, but I don't see why it wouldn't be
>> rendering the struts tags at all. For instance, if I even add ONE struts
>> tag
>> in the middle of my working code that isn't the html:form tag, the entire
>> jsp page will not be rendered at all. It's driving me nuts, I've been
>> working on figuring this out for far too long and would greatly
>> appreciate
>> some input.
>>
>>
>> ---JSP---
>> <%...@taglib uri="/taglib/struts-html" prefix="html"%>
>> <%...@taglib uri="/taglib/struts-bean" prefix="bean"%>
>> <%...@page
>> import="com.thomson.west.pubrec.optout.ui.servlet.SSNLookupAction"
>> %>
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Struts-HTML-taglib-vs.-Standard-HTML-tags-tp26636386p26663145.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Struts HTML taglib vs. Standard HTML tags

2009-12-04 Thread davargas123

When I change the standard HTML tags of my .jsp page into the Struts tags,
the page loads up completely blank, aside from what is loaded by the
tiles-def. What could be causing this? I'm thinking that's why my page
doesn't submit data to the actionform, but I don't see why it wouldn't be
rendering the struts tags at all. For instance, if I even add ONE struts tag
in the middle of my working code that isn't the html:form tag, the entire
jsp page will not be rendered at all. It's driving me nuts, I've been
working on figuring this out for far too long and would greatly appreciate
some input.


---JSP---
<%...@taglib uri="/taglib/struts-html" prefix="html"%>
<%...@taglib uri="/taglib/struts-bean" prefix="bean"%>
<%...@page import="com.thomson.west.pubrec.optout.ui.servlet.SSNLookupAction"
%>
   

function encryptSSN(){
document.ssnLookupForm.submit();
}


function showError(){
document.getElementById('error').style.display='block';
document.getElementById('box1').style.display='none';
}

function validateSSN(){
var ssn = document.ssnLookupForm.ssn.value;
if( /^\d{3}-\d{2}-\d{4}$/.test(ssn) == false ){
showError();
}else{
   encryptSSN();
}
}



  
 
SSN: 
 
Format: XXX-XX-
 
  
 
   
 
 
  
   Encrypted Value: <%=ssnLookupForm.getEncryptedSSN()%>
   
  
   
   

--
This is the corresponding ActionForm:

public class SSNLookupForm extends ActionForm{

private static Logger log =
  Logger.getLogger(SSNLookupForm.class.getName());
   
private String ssn = "XXX-XX-";
private String encryptedSSN = "[Encrypted Value]";
   
public String getSSN(){
return ssn;
}
   
public void setSSN(String ssn){
this.ssn = ssn;
}
   
public String getEncryptedSSN(){
return encryptedSSN;
}
   
public void setEncryptedSSN(String encryptedSSN){
this.encryptedSSN = encryptedSSN;
}
   
public void reset(ActionMapping mapping, HttpServletRequest request)
{
this.ssn = "XXX-XX-";
this.encryptedSSN= "[Encrypted Value]";
}
   
} 
-- 
View this message in context: 
http://old.nabble.com/Struts-HTML-taglib-vs.-Standard-HTML-tags-tp26636386p26636386.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Struts HTML taglib vs. Standard HTML tags

2009-12-04 Thread davargas123

When I change the standard HTML tags of my .jsp page into the Struts tags,
the page loads up completely blank, aside from what is loaded by the
tiles-def. What could be causing this? I'm thinking that's why my page
doesn't submit data to the actionform, but I don't see why it wouldn't be
rendering the struts tags at all. For instance, if I even add ONE struts tag
in the middle of my working code that isn't the html:form tag, the entire
jsp page will not be rendered at all. It's driving me nuts, I've been
working on figuring this out for far too long and would greatly appreciate
some input.


---JSP---
<%...@taglib uri="/taglib/struts-html" prefix="html"%>
<%...@taglib uri="/taglib/struts-bean" prefix="bean"%>
<%...@page import="com.thomson.west.pubrec.optout.ui.servlet.SSNLookupAction"
%>
   

function encryptSSN(){
document.ssnLookupForm.submit();
}


function showError(){
document.getElementById('error').style.display='block';
document.getElementById('box1').style.display='none';
}

function validateSSN(){
var ssn = document.ssnLookupForm.ssn.value;
if( /^\d{3}-\d{2}-\d{4}$/.test(ssn) == false ){
showError();
}else{
   encryptSSN();
}
}



  
 
SSN: 
 
Format: XXX-XX-
 
  
 
   
 
 
  
   Encrypted Value: <%=ssnLookupForm.getEncryptedSSN()%>
   
  
   
   

--
This is the corresponding ActionForm:

public class SSNLookupForm extends ActionForm{

private static Logger log =
  Logger.getLogger(SSNLookupForm.class.getName());
   
private String ssn = "XXX-XX-";
private String encryptedSSN = "[Encrypted Value]";
   
public String getSSN(){
return ssn;
}
   
public void setSSN(String ssn){
this.ssn = ssn;
}
   
public String getEncryptedSSN(){
return encryptedSSN;
}
   
public void setEncryptedSSN(String encryptedSSN){
this.encryptedSSN = encryptedSSN;
}
   
public void reset(ActionMapping mapping, HttpServletRequest request)
{
this.ssn = "XXX-XX-";
this.encryptedSSN= "[Encrypted Value]";
}
   
} 
-- 
View this message in context: 
http://old.nabble.com/Struts-HTML-taglib-vs.-Standard-HTML-tags-tp26636383p26636383.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Struts HTML taglib vs. Standard HTML tags

2009-12-04 Thread davargas123

When I change the standard HTML tags of my .jsp page into the Struts tags,
the page loads up completely blank, aside from what is loaded by the
tiles-def. What could be causing this? I'm thinking that's why my page
doesn't submit data to the actionform, but I don't see why it wouldn't be
rendering the struts tags at all. For instance, if I even add ONE struts tag
in the middle of my working code that isn't the html:form tag, the entire
jsp page will not be rendered at all. It's driving me nuts, I've been
working on figuring this out for far too long and would greatly appreciate
some input.


---JSP---
<%...@taglib uri="/taglib/struts-html" prefix="html"%>
<%...@taglib uri="/taglib/struts-bean" prefix="bean"%>
<%...@page import="com.thomson.west.pubrec.optout.ui.servlet.SSNLookupAction"
%>
   

function encryptSSN(){
document.ssnLookupForm.submit();
}


function showError(){
document.getElementById('error').style.display='block';
document.getElementById('box1').style.display='none';
}

function validateSSN(){
var ssn = document.ssnLookupForm.ssn.value;
if( /^\d{3}-\d{2}-\d{4}$/.test(ssn) == false ){
showError();
}else{
   encryptSSN();
}
}



  
 
SSN: 
 
Format: XXX-XX-
 
  
 
   
 
 
  
   Encrypted Value: <%=ssnLookupForm.getEncryptedSSN()%>
   
  
   
   

--
This is the corresponding ActionForm:

public class SSNLookupForm extends ActionForm{

private static Logger log =
  Logger.getLogger(SSNLookupForm.class.getName());
   
private String ssn = "XXX-XX-";
private String encryptedSSN = "[Encrypted Value]";
   
public String getSSN(){
return ssn;
}
   
public void setSSN(String ssn){
this.ssn = ssn;
}
   
public String getEncryptedSSN(){
return encryptedSSN;
}
   
public void setEncryptedSSN(String encryptedSSN){
this.encryptedSSN = encryptedSSN;
}
   
public void reset(ActionMapping mapping, HttpServletRequest request)
{
this.ssn = "XXX-XX-";
this.encryptedSSN= "[Encrypted Value]";
}
   
} 
-- 
View this message in context: 
http://old.nabble.com/Struts-HTML-taglib-vs.-Standard-HTML-tags-tp26635943p26635943.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Struts HTML taglib vs. Standard HTML tags

2009-12-04 Thread davargas123

When I change the standard HTML tags of my .jsp page into the Struts tags,
the page loads up completely blank, aside from what is loaded by the
tiles-def. What could be causing this? I'm thinking that's why my page
doesn't submit data to the actionform, but I don't see why it wouldn't be
rendering the struts tags at all. For instance, if I even add ONE struts tag
in the middle of my working code that isn't the html:form tag, the entire
jsp page will not be rendered at all. It's driving me nuts, I've been
working on figuring this out for far too long and would greatly appreciate
some input.


---JSP---
<%...@taglib uri="/taglib/struts-html" prefix="html"%>
<%...@taglib uri="/taglib/struts-bean" prefix="bean"%>
<%...@page import="com.thomson.west.pubrec.optout.ui.servlet.SSNLookupAction"
%>


function encryptSSN(){
document.ssnLookupForm.submit();
}


function showError(){
document.getElementById('error').style.display='block';
document.getElementById('box1').style.display='none';
}

function validateSSN(){
var ssn = document.ssnLookupForm.ssn.value;
if( /^\d{3}-\d{2}-\d{4}$/.test(ssn) == false ){
showError();
}else{
   encryptSSN();
}
}



  
 
SSN: 
 
Format: XXX-XX-
 
  
 
   
 
 
  
   Encrypted Value: <%=ssnLookupForm.getEncryptedSSN()%>
   
  
   
   

--
This is the corresponding ActionForm:

public class SSNLookupForm extends ActionForm{

private static Logger log =
  Logger.getLogger(SSNLookupForm.class.getName());
   
private String ssn = "XXX-XX-";
private String encryptedSSN = "[Encrypted Value]";
   
public String getSSN(){
return ssn;
}
   
public void setSSN(String ssn){
this.ssn = ssn;
}
   
public String getEncryptedSSN(){
return encryptedSSN;
}
   
public void setEncryptedSSN(String encryptedSSN){
this.encryptedSSN = encryptedSSN;
}
   
public void reset(ActionMapping mapping, HttpServletRequest request)
{
this.ssn = "XXX-XX-";
this.encryptedSSN= "[Encrypted Value]";
}
   
}


-- 
View this message in context: 
http://old.nabble.com/Struts-HTML-taglib-vs.-Standard-HTML-tags-tp26635930p26635930.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Losing ActionForm Data on submit

2009-12-03 Thread davargas123

So, I have an issue where when I submit a form, instead of the corresponding
ActionForm being populated with the correct field data, it remains
unpopulated for a reason unknown to me. Here is the form on my JSP page(js
functions provided for clarity, very simple):


function encryptSSN(){
document.ssnLookupForm.submit();
}


function showError(){
document.getElementById('error').style.display='block';
document.getElementById('box1').style.display='none';
}

function validateSSN(){
var ssn = document.ssnLookupForm.ssn.value;
if( /^\d{3}-\d{2}-\d{4}$/.test(ssn) == false ){
showError();
}else{
   encryptSSN();
}
}



  
 
SSN: 
 
Format: XXX-XX-
 
  
 
   
 
 
  
   Encrypted Value: <%=ssnLookupForm.getEncryptedSSN()%>
   
  
   
   

--
This is the corresponding ActionForm:

public class SSNLookupForm extends ActionForm{

private static Logger log =
  Logger.getLogger(SSNLookupForm.class.getName());

private String ssn = "XXX-XX-";
private String encryptedSSN = "[Encrypted Value]";

public String getSSN(){
return ssn;
}

public void setSSN(String ssn){
this.ssn = ssn;
}

public String getEncryptedSSN(){
return encryptedSSN;
}

public void setEncryptedSSN(String encryptedSSN){
this.encryptedSSN = encryptedSSN;
}

public void reset(ActionMapping mapping, HttpServletRequest request) {
this.ssn = "XXX-XX-";
this.encryptedSSN= "[Encrypted Value]";
}

}

---


What should happen is that the user enters the SSN in xxx-xx- format
into the box, and clicks the Encrypt button(the javascript validation works
fine, I've tested it). Then, the form should get populated with the data so
that the Action class can do the background work, and display the page with
the SSN that was input and the value that was created from the encryption. 
I can't figure out why the data isn't being submitted. I tried using the
Struts library tags like  and  and whatnot, but for
some reason the elements wouldn't display on the page when I would use them,
so I just reverted to the regular HTML counterparts. 
The problem is with the form being populated with the data, because I hard
coded in a value for the SSN in my action class and the encryption happened
perfectly fine and the page showed up as it should have, but I can't get
user input data to make it to the form, and I'm totally at a loss. Any help
would be greatly appreciated. Keep in mind this is the first time I've ever
had to use anything like Struts.
-- 
View this message in context: 
http://old.nabble.com/Losing-ActionForm-Data-on-submit-tp26627694p26627694.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org