<div>I'am sorry but of course i have getter&setter methods in my page class.</div>
<div>And i also has these namespace in my html file.</div>
<div>It's my fault that i didn't peist these code .</div>
<div> </div>
<div>As i said , i don't want to show the <font color="#550055">inputFileUpload,</font><font color="#000000">thus i hide it.</font></div>
<div>I want to use another button to achieve the upload function, </div>
<div>so i wrote a js to call the inputFileUpload's click method , when i clicked another button.</div>
<div> </div>
<div>I wanna if these's something wrong with my web.xml?</div>
<div>should i write anything else ?</div>
<div> </div>
<div><span class="gmail_quote">2007/10/11, Shinpei Ohtani <<a href="mailto:shinpei.ohtani@gmail.com">shinpei.ohtani@gmail.com</a>>:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hey,<br><br>Ok, I see there might be some problems.<br><br>Is there setter/getter for "private UploadedFile applyFile"?
<br>We must have it.<br><br>And I also mention that your html has namespace something like below<br>to use FileUpload.So, make sure for that.<br><br><?xml version="1.0" encoding="UTF-8"?><br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
1.0 Transitional//EN"<br>"<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"><br><html xmlns:x="<a href="http://myfaces.apache.org/tomahawk">
http://myfaces.apache.org/tomahawk</a>"<br>xmlns="<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>" xml:lang="ja" lang="ja"><br><br><br>I don't get there is some javascript for the button, but
<br>I think it does not need to.What is it for?<br><br><br>Before having more help from this ML,<br>please see upload example from teeda-html-example.<br>(<a href="http://teeda.seasar.org/download/2007-10-10/teeda-html-example-1.0.11-SP1.zip">
http://teeda.seasar.org/download/2007-10-10/teeda-html-example-1.0.11-SP1.zip</a>)<br>It might be helpful.<br><br>Thanks, anyway.<br><br><br>2007/10/11, ˔˅ <<a href="mailto:yourslee@gmail.com">yourslee@gmail.com</a>>:
<br>> ----------------------------------------page-----------------------------------------------------<br>> package jp.wess.web.entrcdApply;<br>><br>> public class EntrcdObjectListPage extends BaseGridPage {<br>
> private UploadedFile applyFile;<br>><br>> public String doPaging() {<br>> super.setLimit(2);<br>> applyNoDto.setOffset(super.getNewOffset());<br>> applyNoDto.setLimit
(super.getLimit());<br>> if ("apply".equals(flag)) {<br>> applyTargetInfoItems =<br>> getEntrcdTargetInfoDao().getTargetInfoList(applyNoDto);<br>> super.setCount
(applyNoDto.getCount());<br>> } else {<br>> reissueTargetInfoItems =<br>> getEntrcdReissueTargetInfoDao().getList(applyNoDto);<br>> super.setCount(applyNoDto.getCount
());<br>> }<br>> return null;<br>> }<br>><br>> public String doApplyUpload() throws IOException {<br>> String name = applyFile.getName();<br>> long size =
applyFile.getSize();<br>> System.out.println(name);<br>> System.out.println (size);<br>> InputStream in = null;<br>> OutputStream out = null;<br>> String path = "D:\\aaa.txt";
<br>> in = applyFile.getInputStream();<br>> out = new FileOutputStream(path);<br>> int read = 0;<br>> int byteLength = applyFile.getBytes().length;<br>> byte[] buffer = new byte[byteLength];
<br>> while ((read = in.read(buffer)) != -1) {<br>> out.write(buffer, 0, read);<br>> }<br>> out.close();<br>> in.close();<br>> // long fileSize1 =
applyFile.getSize();<br>> try {<br>> applyFile.getBytes();<br>> } catch (IOException e) {<br>> // TODO Auto-generated catch block<br>>
e.printStackTrace();<br>> }<br>> return null;<br>> }<br>> }<br>> ----------------------------------------html-----------------------------------------<br>> <form id="form">
<br>> <x:inputFileUpload<br>> id="applyFile" name="applyFile" style="display:none"<br>> value="#{entrcdApply_entrcdObjectListPage.applyFile}"<br>> /><br>> <input type="submit" class="button large" value="¥¢¥Ã¥×¥í©`¥É"
<br>> onclick="uploadfile('doApplyUpload','applyFile')"<br>> id="doApplyUpload"/><br>><br>> -------------------------------------------------JavaScript-----------------------------------
<br>><br>><br>> function uploadfile(btna, btnb) {<br>><br>> var buttona = document.getElementsByName(btna);<br>> var buttonb = document.getElementByName(btnb);<br>> buttonb.click();<br>> }<br>><br>
> ÒÔÉÏ¡£<br>> 2007/10/11, Shinpei Ohtani <<a href="mailto:shinpei.ohtani@gmail.com">shinpei.ohtani@gmail.com</a>>:<br>> > Hi,<br>> ><br>> > Let me see your page class and html.<br>> ><br>> > 2007/10/11, ÀîÀÖ <
<a href="mailto:yourslee@gmail.com">yourslee@gmail.com</a>>:<br>> > > I want to upload file,but i don't want to display the inputtext and<br>> button<br>> > > as system designed ,so i hiddened it .
<br>> > > I'd like to place a button to call the uploadfile button which is<br>> hidden.<br>> > ><br>> > > My code is like this:<br>> > ><br>> > > <x:inputFileUpload<br>
> > > id="applyFile" style="display:none" name="applyFile"<br>> > > value="#{Apply_ListPage.applyFile}"<br>> > > /><br>> > > <input type="submit" name="applyupload"
<br>> value="¥¢¥Ã¥×¥í©`¥É"<br>> > > onclick="uploadfile('doApplyUpload','applyFile')"<br>> > > id="doApplyUpload"/><br>> > ><br>> > ><br>
> > > function uploadfile(btna, btnb) {<br>> > ><br>> > > var buttona = document.getElementsByName(btna);<br>> > > var buttonb = document.getElementsByName(btnb);<br>> > > buttonb.click
();<br>> > > }<br>> > > It doesn't work. Why?<br>> > ><br>> > > Is there any other way to achieve my goal.<br>> > > _______________________________________________<br>> > > Seasar-user mailing list
<br>> > > <a href="mailto:Seasar-user@ml.seasar.org">Seasar-user@ml.seasar.org</a><br>> > > <a href="https://ml.seasar.org/mailman/listinfo/seasar-user">https://ml.seasar.org/mailman/listinfo/seasar-user
</a><br>> > ><br>> > ><br>> ><br>> ><br>> > --<br>> > =============================<br>> > Shinpei Ohtani<br>> > <a href="mailto:shinpei.ohtani@gmail.com">shinpei.ohtani@gmail.com
</a><br>> > =============================<br>> ><br>> > _______________________________________________<br>> > Seasar-user mailing list<br>> > <a href="mailto:Seasar-user@ml.seasar.org">Seasar-user@ml.seasar.org
</a><br>> > <a href="https://ml.seasar.org/mailman/listinfo/seasar-user">https://ml.seasar.org/mailman/listinfo/seasar-user</a><br>> ><br>> ><br>><br>><br>> _______________________________________________
<br>> Seasar-user mailing list<br>> <a href="mailto:Seasar-user@ml.seasar.org">Seasar-user@ml.seasar.org</a><br>> <a href="https://ml.seasar.org/mailman/listinfo/seasar-user">https://ml.seasar.org/mailman/listinfo/seasar-user
</a><br>><br>><br><br><br>--<br>=============================<br>Shinpei Ohtani<br><a href="mailto:shinpei.ohtani@gmail.com">shinpei.ohtani@gmail.com</a><br>=============================<br><br>_______________________________________________
<br>Seasar-user mailing list<br><a href="mailto:Seasar-user@ml.seasar.org">Seasar-user@ml.seasar.org</a><br><a href="https://ml.seasar.org/mailman/listinfo/seasar-user">https://ml.seasar.org/mailman/listinfo/seasar-user</a>
<br><br></blockquote></div><br>