简体   繁体   中英

Java, servlet access restriction

I work on a Java project with Echo Studio 3. I have a servlet that display a Pdf file. I call this servlet with a button that open a new window with this code:

Command open = new BrowserOpenWindowCommand("http://localhost:8080/MyApp/app/DisplayFile", "_blank");
Application.getActive().enqueueCommand(open);

I would like to allow the access to this servlet only to users who clicked on this button, but I don't know how to handle this.

Any idea?

Pass an additional parameter in the link to identify the click. Or else capture the click event in javascript and add additional parameter to the server url to inform that the button has been pressed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM