I am trying to prevent directory traversal attack on my jsp. As well as sanitising the URL parameters, I want to not expose the directory structure altogether. Is there a way for me to hide/alter the path that the user sees and also in the source code properly?
Hiding href path on hover and source code
421 Views Asked by obsessiveCookie At
1
There are 1 best solutions below
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in JSP
- Why we use double % in Java or JSP
- How to get specific values from select menu and use her in mysql query?
- How to compile an individual jsp file from command line
- How to keep a variable in the URL when using Spring LocaleChangeInterceptor
- How to pass value from input text to jsp variable?
- Importing a downloaded JAR file into a Servlet
- Upload PDF and display on same page
- Use javascript variables in JSP code
- How to add '%' symbol in textbox using jsf and jsp?
- Execute RequestDispatcher after 5 seconds
- Score book using javabean; how do I get overall average?
- Struts2 jqGrid DatePicker in Column Filter
- java.lang.StackOverflowError in spring controller
- Error on java application
- Requested Resource is not available error
Related Questions in PATH
- formatting path string in javascript
- Simplexml get path from variable
- Azure Web App PATH Variable Modification
- In Android, would it be possible to open a file in the 'values' folder and to read its content?
- Using paths bonded to a XCode project to be shared
- How would I be able to use a file in visual studio project on any computer?
- How to add directories to Cygwin gcc default search path
- Joomla css path incorrect
- R CMD recognize only some commands
- Generate TCPDF output to a shared drive folder
- How to get the exe path in nsis script?
- Issues with relative/absolute path
- relative path to .Exe
- Path of the current, parents and root directory
- JOptionPane Message with File Path
Related Questions in HREF
- Under what conditions does href="#" cause scrolling to the top of the page?
- Links with images and text - combined or separate?
- Copy the a href value to a textbox onclick
- Html | set <a> href url with jQuery
- pass href text to modal
- HTML href - how to not rewrite GET parametrs
- How do I use variables in my href when downloading a file?
- How to replace href inside of <li> using jQuery
- How can i get element by href using javascript and after that, click?
- Can't href a link from my table 'ID' column
- Download local files using href
- How to HREF the INDEX
- jquery $(this).attr('href') returns undefined
- how to set href to outter website programatically?
- How to enable a href link on click of a button in JavaScript not in jQuery?
Related Questions in COPY-PROTECTION
- Web content screen capture copy-protection
- Image asset protection/encryption in an Android app
- Generate file on USB drive that can not be deleted or copied in VB.NET
- Is it possible to safely validate offline license keys clientside?
- Hiding simple code using a header file?
- Preventing web images from being taken
- Can I get the type of copy protection on a CD/DVD in C#?
- How to install APK Expansion Files without hosting on Developer Console?
- Hiding href path on hover and source code
- Best Way to Obfuscate My DL Models and Python?
- How to run code right when a C# application starts?
- How to Bind SWFs to a Host?
- Prevent copying text in web-page
- How to validate paid iOS app
- Why jQuery Plugins code is shown in source code
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
One approach is to place your JSPs under the WEB-INF folder. The servlet engine will restrict direct access to any files under the WEB-INF folder, which achieves your goal.
To be able to use this approach, all your links and form actions should map to servlets or a similar component in the framework you're using (e.g. actions in Struts, controllers in Spring MVC, etc.). You cannot expose direct links to JSP pages (which is a bad idea anyway).
For example, if you're using Spring MVC, the link will point to a URL which is mapped to a Controller. The controller will retrieve the data required to be displayed on the JSP and then forwards to the JSP (using the appropriate Spring MVC approach).
HTH