You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Yeeswara Nadapana (HCL Financial Services)" <Ye...@hcl.in> on 2008/03/06 10:45:10 UTC

How to Upload a file to my server

Hi,

 

I am using Tapestry 5 for my application. I want to upload an excel file
to the Tomcat server. On HTML, I am using the <input t:type="upload"
t:id="strategyFile" /> and on java file, I written as:

 

File stratFile = new File("c:/temp/"+strategyFile.getFileName());

strategyFile.write(stratFile);

 

But, I cannot exactly find the file on my server. Am I missing something
to get the file uploaded to my server? Please explain...

 

Thanks and Regards

Yeeswara N

************************************************************************
****

This mail is transmitted to you on behalf of HCL Technologies.

Diese Post wird Ihnen im Namen der HCL Technologies ubermittelt

************************************************************************
****

 



DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in 
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of 
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have 
received this email in error please delete it and notify the sender immediately. Before opening any mail and 
attachments please check them for viruses and defect.

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

Re: How to Upload a file to my server

Posted by Angelo Chen <an...@yahoo.com.hk>.
can't find anything wrong, try to dump the file name, is it valid?

private String fname = "c:/temp/"+strategyFile.getFileName();
System.out.println(fname);



Yeeswara Nadapana (HCL Financial Services) wrote:
> 
> 
> File stratFile = new File("c:/temp/"+strategyFile.getFileName());
> 
> strategyFile.write(stratFile);
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-Upload-a-file-to-my-server-tp15869969p15873114.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Random Stale Link exceptions (without back button usage)

Posted by Tobias Marx <su...@gmx.de>.
I keep on getting random stale link exceptions in a Tapestry 4.1 application.

I am not using the browser's back button, however. The error is not reproducable and just "happens" to appear every 20th or 30th time a form is submitted.

The error message:

"Rewind of form Home/$Form expected only 0 form elements, but an additional id was requested by component Home/$TextField."

The generated HTML looks like that:

<form method="post" action="/Home,$Form.sdirect" id="Form">
<div style="display:none;" id="Formhidden"><input type="hidden" name="formids" value="tkeywords,p1,p2,s1" />
<input type="hidden" name="submitmode" value="" />
<input type="hidden" name="submitname" value="" />
</div>
          <div class="abstand-suche-text">Suchbegriff: 
            <input type="text" name="tkeywords" value="" id="tkeywords" class="eingabefeld" />
            <div class="strich-suche"></div>

          </div>
         
          <div class="abstand-suche-text">Wählen sie ggf. eine Kategorie: 
            <select name="p1" id="p1" class="eingabefeld">
<option value="24">Laurel &amp; Hardy</option>
</select>
            <div class="strich-suche"></div>
          </div>
          <div class="abstand-suche-text">Verwertungsmöglichkeiten: 
            <select name="p2" id="p2" class="eingabefeld">

<option value="0">-</option>
<option value="10">Web</option>
<option value="11">Mob</option>
<option value="12">Gr</option>
<option value="13">Ad</option>
<option value="14">mob</option>
</select>
            <div class="strich-suche"></div>
          </div>

          <div class="abstand-suche-text"> 
            <input type="submit" name="s1" id="s1" value="Suchen" class="button1" />
          </div>
          
          </form>


The Java code looks like that:

// both client and non-client persistence does have the same effect

@Persist("client")  
public abstract Category getSelectedCategory();
	
@Persist("client") 
public abstract License getSelectedLicense();
	
@Persist("client") 
public abstract String getKeywords();
	

The Template looks like that:

        <form jwcid="@Form" id="f1">
          <div class="abstand-suche-text"><span key="search.contextSearch" />: 
            <input class="eingabefeld" jwcid="@TextField" value="ognl:keywords" id="tkeywords"/>
            <div class="strich-suche"></div>
          </div>
         
          <div class="abstand-suche-text"><span key="search.chooseCategory" />: 
            <span jwcid="@PropertySelection" model="ognl:categoryModel" value="ognl:selectedCategory" class="eingabefeld" id="p1"/>
            <div class="strich-suche"></div>
          </div>
          <div class="abstand-suche-text"><span key="search.opportunities" />: 
            <span jwcid="@PropertySelection" model="ognl:licenseModel" value="ognl:selectedLicense" class="eingabefeld" id="p2"/>
            <div class="strich-suche"></div>
          </div>
          <div class="abstand-suche-text"> 
            <input type="submit" class="button1" value="message:search" jwcid="@Submit" action="listener:doSearch" id="s1"/>
          </div>
          
          </form>

Any ideas?


Tobias

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org