applet & standard form attachments doubt - Java Applet Development

Hello everybody,
I would really appreciate it if somebody can confirm if it is possible to set the value from a input type field on an standard html form through an applet.
Basically the applet would let the users browse images hosted on a remote application to finally
let them attach it to the form
I can't use a standard file input because of the need of querying the remote application, also the form is processed for a third application that just accepts standard
forms.
Any help would be really appreciated.
Edited by: user7768929 on Sep 27, 2010 5:59 AM 

Google for "JSObject". This link looks like the most up-to-date to me: http://download-llnw.oracle.com/javase/6/docs/technotes/guides/plugin/developer_guide/java_js.html.
So the answer is yes, but from my experience, there may be combinations of browsers/platforms/JRE's that do not quite work. Beware especially of the Mac! 

Hi Baftos,
Thanks for your prompt response.
I'm afraid I've been trying to figure out this myself and it seems that javascript its specifically not allowed to [modify input type fields for security reasons.|http://www.codingforums.com/archive/index.php/t-97159.html]
I'm starting to think that my approach is not possible and I should start considering other options.
Thanks a lot, Javier. 

After reading your link, I think this applies to "file" fields only, which, if I understand well, you do not intent to use. But I am not sure.
Anyway, if you can find an approach that does not involve applets, it would be better.

Related

How to design approval before download of file

Hello,
I am designing a Java ME application and a web page. On the web page you can order the Java ME application which you later download on your phone. You receive a reference number when you have completed ordering the application on the web page. In step two you use your mobile phone to access a page where you enter the reference number and the download of the Java ME application starts.
Now my problem: It should not be possible to download the application by just accessing a link and, hence, bypassing entering the refernce number. The link must be protected from "theft", the order must be confirmed.
How do I design/implement this? I am using Tomcat and Struts in case any built-in features can be used.
Thank you in advance!
Regards,
Niklas
Edited by: Nic_Soft on Apr 30, 2009 1:25 AM 
There are two parts to this: protect access to the download and verify the reference number.
The first part is easy. If you get a page request that doesn't contain a valid reference number, return an error or other non-download page. The key here is to realize that web pages are not physical entities. All web pages are simply responses to a request. You can interpret the request however you like and likewise respond any way you please.
For the verification, you have a couple of options. One is that when the order is taken a code is generated for that customer and stored in a database. When they later request the application, you check their code against the database value you have stored. Another option is to take some pieces of information that identify the customer and create a one way hash or digest against a secret key. When they come later, you take those same bits of info and create the hash again. If this matches the value the provided, you allow the download. 
Thanks for your reply,
The second part I am ok with. The first part I was actually looking for a low-level answer. Such as:
1. Access a servlet
2. Verify the user/download
3. Return the file to the mobile by.....
Any suggestions? Preferable if it is possible do a nice design using Struts2.
Regards,
Niklas 
Nic_Soft wrote:
Thanks for your reply,
The second part I am ok with. The first part I was actually looking for a low-level answer. Such as:
1. Access a servlet
2. Verify the user/download
3. Return the file to the mobile by.....You can return a file from a servlet request. Otherwise, search the struts docs for "downloads". You can use the code as part of the URL, perhaps as a parameter.
Any suggestions? Preferable if it is possible do a nice design using Struts2. I'm not sure it's ever possible to have a nice design with Struts2. I've never seen one. I've heard they exist, though. 
Hello,
Thank you for your answer. I posted a new thread in Java ME forum: [How to download a protected Java ME application using Struts2 and actions |http://forums.sun.com/thread.jspa?threadID=5384270&messageID=10698818#10698818]
I think it is a better place for my question at this point.
Regards,
Niklas
Edited by: Nic_Soft on May 4, 2009 1:15 AM

About Dynamic Form in JSP

Hi,
I want to create jsp page which can add/delete/modify and even move text boxes with label to one place to other.
i found partially solution like Xform and even thru java script. But still don't know how to do that.
Can any body have ever come across this type of form.
please give me your valuable comments may be from there i will get some trick.
Thanks,
Ankur
Edited by: joyhotfever on Sep 3, 2008 2:04 AM 
Your question is too general.
Learn HTML. Learn Java. Learn JSP/Servlets. Learn JavaScript -if necessary.
Then write code accordingly. Whenever you stucks while solving a technical coding problem, you're always welcome to ask it here. 
I think the term you need to search for in google for what you want is this:
html drag drop
Here is one link that might help:
http://www.webreference.com/programming/javascript/mk/column2/

Need Help! Feeding Database Items into A Drop Down Menu

Hi all! Im kind of new to Java and been doing this for 2 months or so now. I need some help. :)
Now i am using MySql and Apache as my database and web servers. My database is within MySql. It generates XML based on a given criteria that i give it through the use of an SQL statement. I have also begun to learn XSLT, tha transformation process that this XML can be put through. Now what i wanted to do was to be able to feed a drop down menu with one item of information, in this case the name of 12 CDs in all. Having done this, i would then like to populate a 2nd drop down menu based on the information given in the 1st menu. And then based on the selection made in the 2nd menu for relevant data of my choosing to be retrieved from the database, again through an SQL statement.
I am learning XML, XSLT an XHTML using J3T - Java based. Therefore i need the criteria above to be fulfilled in java - any other forum i have been on have issued solutions in ASP. I need it in java.
I realize im new to this but i would really appreciate some help with this.
Thankyou for your time. 
You don't need XSLT for this.
You can pass XML to a JSP and simply display it using JSTL.
You'd be better off learning JSTL, the JSP standard tag library. I recommend Hans Bergsten's JSP book from O'Reilly.
% 
Which part are you having trouble with?
Querying the DB?
Transforming with XSLT?
Populating the dropdowns?
What have you tried so far and what specifci problems did you encounter? 
Thankyou for your speedy replies
To be honest all i have tried is an foreach function that would send the database info into a drop down menu but that hasent worked. So am looking for a start up as to how it can be done really. or anything at all you think can help. I can query the database - its populating the database that i am having problems with.,
Edited by: Nabz on Feb 7, 2008 7:31 AM 
Additionally, where are the dropdowns ... html, java app or applet? 
Drop downs are in HTML, or XHTML in this case. For clarification, XHTML is HTML with XML. 
To have the text of the second dropdown box change you're probably better off using JavaScript to change the contents of the drop down on the client side when the first box is changed.
My JavaScripts quite terrible so I won't pretend to have a solution for you. :-) 
Nabz wrote:
Thankyou for your speedy replies
To be honest all i have tried is an foreach function that would send the database info into a drop down menu but that hasent worked. So am looking for a start up as to how it can be done really. or anything at all you think can help. I can query the database - its populating the database that i am having problems with.,
Edited by: Nabz on Feb 7, 2008 7:31 AMYou'll need to provide a lot more detail than that. Show your code and provide details of what "doesn't work" means.
Use the CODE button or [code] and [/code] tags to keep your code readable. 
Another way to do it, if you can stand another network round trip, would be to write a servlet to interact with that page. Let the JSP pass the selected value from the first drop down to the servlet. Let it do the query to get the contents of the second drop down based on the selected value and add the collection to the page as an attribute and return to the page again.
%

UCM checkin validation

hi,
I got some difficulties in doing validation check during the content check in process, is there any way to do so such as checking the duplicated title, or other custom metadata fields??
Many thanks and regards,
Edited by: user8960906 on Mar 4, 2010 7:46 AM 
This kind of work is sometimes performed by creating a component and using the validateStandard Java filter where you can do things like access the database to check for a previous piece of content with the same title or whatever other data validation you need to do.
To get started, check out the how-to components on oracle's site:
http://www.oracle.com/technology/products/content-management/ucm/samples/HowToComponentsBundle.zip 
Thx for your help!
i probably know how to do it..
but the problem is....
is there any website or tutorial that talk about how to access the db using java class..?
Thanks so much if anyone can help? 
The how-to components show this as well. Basically you just use the workspace object and and execute a command passing the sql you want to execute and it hands you back a ResultSet object. 
Moreover, in the stage of validateStandard, is it possible to stop the checkin process then go to another service, when there are some fields are duplicated??

access date, created date of a file

can somebody please help me with a piece of code to retrieve the accessed date and created date of a file. basically, java.io.File object gives me a method lastModifiedDate() but doesn't allow me get the accessed date or created date. pointers to any other API is welcome.
Thanks. 
This question has been asked many times on these forums; however, I am not sure you will get the answer you would like:
http://forum.java.sun.com/thread.jspa?forumID=31&threadID=780277
http://forum.java.sun.com/thread.jspa?forumID=31&threadID=664659
http://forum.java.sun.com/thread.jspa?forumID=513&threadID=207333
etc. 
How can tell visitors to my site when a PDF on the web server has been replaced or updated?
Edited by: kennethwinfrey on Jan 16, 2008 3:48 PM 
kennethwinfrey wrote:
How can tell visitors to my site when a PDF on the web server has been replaced or updated?I seem to be missing something. Where does java fit in here? You're not thinking of javascript are you? 
I thought it was understood that questions here were java related.
To clarify further:
I have a site where users can download a periodical published as a PDF file.
The file itself is updated weekly, but not always the same day of the week.
The only way for visitors to know if the file is updated is to click the link (always the same) and open the file.
I want to know if there is way to get the datecreated property (via javascript) of the PDF file and publish it on the page so that visitors won't have to click the link to see the file itself. 
kennethwinfrey wrote:
I thought it was understood that questions here were java related.Most are. Yours isn't. Javascript is not Java, not even close.
To clarify further:...Get thee to a javascript forum. 
I've heard them referred to at least as "distant cousins," but thanks for the distinction! Javascript folks use the term "Java" way too much...it throws a newbie like me way off.
Thanks again! 
much luck!

Categories

Resources