jsp 1 « Security « Spring Q&A





1. What tactics can I use to prevent users from discovering what language a website is written in?    stackoverflow.com

So, if you are writing a website using Java and JSP's and didn't want users to know what language you written it in. What techniques would you use?

2. Conditionally Render In JSP By User    stackoverflow.com

I'm trying to make a simple forum just to get the hang of the Spring Security and MVC frameworks. For simplicity's sake, let's I have a JSP to view a forum post, ...

3. how to display custom error message in jsp for spring security auth exception    stackoverflow.com

I want to display custom error message in jsp for spring security authentication exceptions. For wrong username or password,

spring displays : Bad credentials
what I need     : Username/Password entered ...

4. Spring-MVC is adding on an extra .jsp extention to the URL a user enters    stackoverflow.com

The error message I get is description The requested resource (/gradebook/WEB-INF/jsp/hello.jsp.jsp) is not available. I have a WEB-INF/jsp directory that contains hello.jsp Spring appears to be adding the jsp extension and ...

5. how to conditionally show jsp content to logged in users with Spring security    stackoverflow.com

I want to show content to any user that is logged in and to hide if they are not logged in. I'm using jsp's and spring security. Obviously a home grown ...

6. How do I convert JSP (custom tags) to Code in a servlet in Spring Security?    stackoverflow.com

I am working on a project where I have to include some code from a JSP. This JSP has code as follows (related to Spring Security) ...

<%@ taglib ...

7. Should I implement a custom properties file based authorization tag to go with authz from Acegi Security?    stackoverflow.com

I'm searching for the best way to handle view-level authorization (where you hide markup based on a user's roles). The typical way to do this is with the Acegi Security authz tag, ...

8. Custom tag - get access to data in model?    stackoverflow.com

I am creating a custom JSP tag by extending SimpleTagSupport. Normally in the view, I could do something like <c:out value="${key.attr}" /> using jstl to pull data from the model. ...

9. Access FlowScope from JSP without JSTL    stackoverflow.com

I'm using Spring Web Flow (v. 1.0.5) and I have a JSP page that makes an AJAX call to a flow and needs to read in the XML results. That ...





10. How can I connect two users so they can share common object (game instance) with use of J2EE web technologies (JSP, Spring etc.)?    stackoverflow.com

My idea is that player 1 creates a game (for two players), server returns him a URL, player 1 sends this URL to player 2 and the player 2 opens URL ...

11. Can an Aspect conditionally render parts of a JSP page?    stackoverflow.com

At present the jsp pages have normal authorize tags to conditionally render links and information etc. The website is on the intranet, and we're using Spring Security 2.0.4. Ive now got a ...

12. Can I access Spring session-scoped beans from application-scoped beans? How?    stackoverflow.com

I'm trying to make this 2-player web game application using Spring MVC. I have session-scoped beans Player and application-scoped bean GameList, which creates and stores Game instances and passes them to ...

13. Testing if a User is Logged in Via JSP/Spring-MVC    stackoverflow.com

Using Spring 3 MVC and JSP, I simply want to test if a user is logged in, I'm not interested in using Spring Security currently

<jsp:useBean id="myAppUser" type="com.xxx.MyUser" beanName="myUser" scope="session" />
<c:choose>
  ...

14. spring security changing spring_security_login form    stackoverflow.com

i am using spring security and i am wondering how to change the default login form i have found out that i need to point to my new form location. ...

15. Spring Security 2.0, Getting the authentication status of a user    stackoverflow.com

I am working on a webapp which uses Spring security 2.0 (not the new one), which we don't have the Java sources, but we do have access to the jsp. What is ...

16. How to get SavedRequest in Spring Security 3 in login.jsp?    stackoverflow.com

How to get SavedRequest in Spring Security 3 in login.jsp ? I found an example :

<%@page import="org.springframework.security.web.savedrequest.SavedRequest"%>
<%

SavedRequest savedRequest = (SavedRequest) session.getAttribute(AbstractProcessingFilter.SPRING_SECURITY_SAVED_REQUEST_KEY);

.... %>
But this doesn't work in SpringSecurity 3.





17. How do I access ModelMap in a jsp?    stackoverflow.com

How can an object be accessed from the ModelMap in jsp so that a method can be called on it? Currently I recieve this error:

Syntax error on token "$", delete ...

18. (Question about 'final' and) How do I access the list object contents of 'myModels' from the Spring ModelMap in JSTL?    stackoverflow.com

@RequestMapping(value = "/index", method = RequestMethod.GET)
public final String index(final ModelMap model)
{
      List myModels = ArrayList<MyModel>(getMyModels());
      model.addAttribute("mymodel", myModels);
     ...

19. spring mvc security. user login on every page    stackoverflow.com

I want to store user information after logging in and to display my login and username on every page (using jsp). How can I get access in my jsp views to ...

20. applying JSP/JSTL's to a path inside a servlet    stackoverflow.com

In our JSP pages, we use extensively. Works great, rewrites the URL to deal with sessionids, contexts, etc. But now we need to do some of this work ...

21. Determine secure url in JSP with spring security    stackoverflow.com

Like many websites, I have a login popup on every webpage of my site. Most of these pages are http (non-secure). But the login mechanism has to post to ...

22. how to access a ModelAndView object within the jsp page    stackoverflow.com

Hi I have a code like this in my controller.

ModelAndView result = new ModelAndView("person/sometrends");  
result.addObject("data", data);  // data -> Map
In my JSP page I have written some Java code ...

23. Why use the j_username and SPRING_SECURITY_LAST_USERNAME variables?    stackoverflow.com

Why do this?

<input type="text" name="j_username" value="${SPRING_SECURITY_LAST_USERNAME}">
instead of this?
<input type="text" name="username" value="">
What's the value of the j_username and SPRING_SECURITY_LAST_USERNAME variables?

24. How to display error message in my JSP page using spring security 2.0    stackoverflow.com

Hi I am now using spring security. It works fine. But if login failed, no error message display. I am wondering how can I display error message? I have configured the ResourceBundleMessageSource ...

25. How to generate content based on spring-security user rights    stackoverflow.com

I want to generate some html content based on the user rights of a user who logged in with spring-security. I can't find much about this subject on the internet so ...

26. Is it possible to secure an included jsp with spring-security?    stackoverflow.com

I got a jsp which imports a jsp file. Is it possible to secure the import with a spring-security configuration? For example i want to use this line of code:

<c:import url="jsp/admin/add_user.jsp" />
But ...

27. Spring Security: How do I reset SPRING_SECURITY_LAST_EXCEPTION.message?    stackoverflow.com

I am able to display the SPRING_SECURITY_LAST_EXCEPTION.message ("Bad Credentials") when a user tries to log in with incorrect credentials. My login jsp currently uses the following code:

      ...

28. Spring and Hibernate: How to modify user authorities using jsp and checkboxes    stackoverflow.com

I am using spring security and have an admin jsp page for editing user details. I want to be able to grant or revoke authorities on this page. The ...

29. Access spring web application context beans in EL expression    stackoverflow.com

I'm new to Spring MVC and have the following situation: In WEB-INF/demoshop-servlet.xml I have the following line:

<bean id="someBean" class="com.xxx.xxx.web.SomeBean" />
I also have a JSP that contains a line like:
${someBean.someAttribute}
I expected that the ...

30. Spring authorization    stackoverflow.com

I have some problems with authorization. So, my app has login.jsp page. web.xml file has this lines:

<welcome-file-list>
    <welcome-file>login.jsp</welcome-file>
</welcome-file-list>
I'm using Spring Security for users authorizing. So, when my app ...

31. Setting a cookie upon login in Spring Security 3.0    stackoverflow.com

I need to set a cookie when someone logs in and the JSP page that comes up needs to be able to read that cookie in Javascript and perform an action ...

32. Spring security in JSP - click on not allowed action    stackoverflow.com

If user clicks on an action in namespace which role user hasn't now nothing happens. Can I intercept this and redirect him to some exception? Example:

    <intercept-url pattern="/secure/project/**" access="ROLE_PROJECT"/>
 ...

33. Spring security tags in sitemesh decorator    stackoverflow.com

I want to use a few tags of the spring security tag library inside the decorator file of site-mesh. However content inside these tags is never shown. Can anyone tell me ...

34. Spring - bean access in JSP    stackoverflow.com

I have configured a bean like this and I have forum.host.url in the file properly

<bean id="forum_host_url" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="forum.host.url"/>
     ...

35. How to return different responses with a normal and ajax login in spring security 3    stackoverflow.com

I build a custom AuthenticationSuccessHandler so users can login using Ajax aswell use a normal login (for users with javascript disabled). To check if it's an ajax call or normal call ...

36. Spring Security and JSF, Failed to find resource /j_spring_security_check.jsp    stackoverflow.com

I am having a little trouble getting Spring Security and JSF to work together properly. I have created a basic login page that returns a "login" outcome when the Login ...

37. I can't find a way to access spring model not using EL    stackoverflow.com

I have problem when creating JSPs to use with Spring. I put all my objects in the Model of ModelAndView, it's easy to access them using EL. The problem is to ...

38. How to correctly bind nested property encapsulating other pojo when user picks that pojo - spring, jsp    stackoverflow.com

Hello fellow stackoverflowers
This is a scenario I am trying to solve.

  • Technologies: Spring 3.0.2, Hibernate 3.2.5, JSP as a view
  • I have one form backing object Zarizeni, which have AutoPopulatingList as na attribute ...

39. How to access a java list coming from the server in javascript inside my jsp    stackoverflow.com

Plz consider the scenario. I have a java class called Person as below:

Person
---------
Integer Id 
String name
String address
Now through my spring controller I pass a list of persons to my jsp page(neighbors.jsp) ...

40. Spring access global value from JSP    stackoverflow.com

In my Spring application I wish to add a configurable system message that can be displayed on every page. For example "The system is going down in 10 minutes". I need to ...

41. Java Spring, how to use JSP files hosted at a remote location?    stackoverflow.com

I have searched on this and found something about using remotely hosted JSPs but it was not specific to Spring and I am not quite sure how to make it work ...

42. Spring Security Authentication Tag and Custom List    stackoverflow.com

I have a custom list attached to the spring principal. I need to iterate the list in a jsp page. How can I do this?

<security:authentication property="principal.websites" />

43. Access Model object in a JSP without using the ModelAndView object?    stackoverflow.com

I am using spring mvc with Annotations, see the following snippet

    @RequestMapping(value = "/configuration/", method = RequestMethod.GET)
    public MyModel viewConfiguration() {
The problem I am having ...

44. Error using Spring authorize tag to check to see if user is logged in?    stackoverflow.com

Trying to test to see if a user is logged in I am using the following code:

<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

<sec:authorize access="isAuthenticated()">
   YES, you are logged in!
</sec:authorize>
But I ...

45. Java, Spring MVC, simplest way to pull any type of file (.png, .jpg, .pdf, .doc, etc) from server and give to user for download?    stackoverflow.com

I have been searching on this but the info I am finding seems overly complex for what I am trying to do or involves having to specify exactly what type of ...

46. How do make Spring access dropdown box values    stackoverflow.com

How do make Spring access dropdown box values. I am trying to make Spring MVC get the value of one of my dropdowns.

org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/view/dateRange.jsp at line ...

47. How to show JSP content based on user's access to URLs with Spring Security    stackoverflow.com

If you want to show content in JSP page based on user's access to one or more URLs, it is easy to do based on user's access to one URL:

<sec:authorize url="/someurl">
 ...

48. How to display login error message at login.jsp page using Spring Security?    stackoverflow.com

I am using Spring Security. I want to display login error message on login.jsp such as login failed or account locked. How can I display such message on login page ? ...

49. how to define our own authentication exception in spring security?    stackoverflow.com

Possible Duplicate:
How to display login error message at login.jsp page using Spring Security?
Im new to spring. In our application authentication is done through ldap. ...

50. how to retrieve some field from ldap in spring security    stackoverflow.com

i m new to spring. i want to retrieve some field of user details from ldap and display on the jsp page. how can i retrieve this filed from ...

51. In a JSP scriptlet, how do you access a java.util.Date value passed from a Spring MVC ModelMap?    stackoverflow.com

FooController.java:

@RequestMapping(value = "/foo", method = RequestMethod.GET)
public final String foo(HttpServletRequest request, ModelMap model)
{
    java.util.Date myDate = new java.util.Date();
    model.addAttribute("myDate", myDate);
    return "foo";
}
foo.jsp:
<%
  ...

52. Problem trying to use spring security with my jsp aplication    stackoverflow.com

It's seems so easy to use spring security following a tutorial, but when I try to do the same with this app I can get it to work (I must admit ...

53. Cannot find a jsp view when spring security is applied    stackoverflow.com

I have a java + spring web application and spring security 3.0 is applied to it. Using the security intercept url I'm trying to apply none filter to a particular view ...

54. Spring Remember-Me not providing correct user details    stackoverflow.com

I used Spring Security 3.0.5's feature "Remember-Me" and in my jsp pages I tried to access the user's details.

public class UserDetailsImpl implements UserDetails, Serializable
with a few extra attributes (picture url, ...

55. How to set value from to the parameter with     stackoverflow.com

I have a problem in my jsp page. I use Spring security and I need to get a name of the authentificated user, for this I use the next tag

 <security:authentication ...

56. Spring MVC model access in jsp failed    stackoverflow.com

i am new to Spring. I created a maven project in eclipse to test Spring MVC by resembling the mvc-basic example from Spring example SVN repository. when i tried to retrieve ...

57. Spring Hibernate access joined database field    stackoverflow.com

my database tables:

cities(id serial, name varchar(40);
weather(id serial, city_id int, temp int, date date)
cities.id = weather.city_id In Spring I have same POJO as the fields in database. for example City.java:
@Entity
@Table(name="CITIES")
public class City {

  ...

58. How do I access a model in JSTL outside of EL?    stackoverflow.com

In Expression Language, I can access my model like so: ${model.member} How do I achieve the same thing when I want to use <%=some_method(${model.member}); %> The reason is because I have some HTML ...

59. access form data in a jsp    stackoverflow.com

I've this form in login.jsp that I use for login in spring security.

<form name="f" action="<c:url value='j_spring_security_check'/>" method="POST">
      <table>
        <tr><td>User:</td><td><input ...

60. Struts: How can I test whether #session has a value for SPRING_SECURITY_LAST_EXCEPTION?    stackoverflow.com

The line

<s:if test="%{#session.SPRING_SECURITY_LAST_EXCEPTION.message != null}">
is giving me the following exception:
Caught an exception while evaluating expression '#session.SPRING_SECURITY_LAST_EXCEPTION.message != null' against value stack
It's not simply that #session.SPRING_SECURITY_LAST_EXCEPTION is null and I'm trying to ...

61. Spring-Security 3.1 java.lang.ClassNotFoundException: org.springframework.security.taglibs.authz.AuthorizeTag    stackoverflow.com

I just upgraded from Spring Security 3.0.5 to 3.1.0.RC3 Now, the following JSP code gives me java.lang.ClassNotFoundException: org.springframework.security.taglibs.authz.AuthorizeTag

<security:authorize access="not hasRole('ROLE_ANONYMOUS')">
Welcome <%= request.getUserPrincipal().getName() %>
</security:authorize>
I look at the Spring Security Reference Documentation ...

62. Cannot access variable inside the included JSP    stackoverflow.com

I am using Spring 2.5 in my application. In the view I have main jsp in which I have included another jsp. I have declared a variable using c:set tag in ...

63. Accessing my custom user object in jsp page, using spring 3 security    stackoverflow.com

I have implemented UserDetailsServce, it returns an instance of MyUser (which implements UserDetails)

public MyUser loadUserByUsername(String arg0)
I now want to access my custom getters/fields on MyUSer in my jsp pages, so far ...

64. How to check if it's the first time the user clicks on a link in JSP?    stackoverflow.com

I have my webapplication structured like this: Main page with n links and a tabbed structure Every link opens a tab in the tabbed structure of the main page and with ajax loads ...

65. show user full name and other fields in jsp header for authenticated user    stackoverflow.com

what i would like to achieve is at the bottom of the header i would like to show a few fields regarding to the authenticated user, the fields i would like to ...

66. Access Model attribute in scriptlet    stackoverflow.com

I am using Spring MVC, and in my Controller, I am setting a standard model attribute using:

...
model.addAttribute("param", value);
...
Now, I wish to access this in a scriptlet (within a JSP). For example:
<% ...

67. spring using security:authentication principal.username in link    stackoverflow.com

Ok this should be an easy one In the header.jspx file i would like to have a link that will lead the authenticated user to their userpage. This is what i am using ...

68. Access to session from jsp / jstl    forum.springsource.org

I know this is stupid but this is how my day is going :? I need access to session from JSTL. When I try the following: I get: ...

69. Authentication via JSP (and redirecting to Flex)    forum.springsource.org

Authentication via JSP (and redirecting to Flex) Hi all, This thread is my alternative to moving a Flex thread on accessing UserDetails. Truthfully, I think I've got it working right, I'm ...

70. using JSP TAG sec:acccess with role hierarchy    forum.springsource.org

using JSP TAG sec:acccess with role hierarchy Hi. Ich can use the sec:access TAG in the following way: Code:

  • Import
  • So just users with ROLE_ADMIN ...

    71.  bypasses Acegi?    forum.springsource.org

    I have simple test app. that secures a subdirectory. If I navigate to that directory directly in the browser, I'm redirected to login form as expected. However if I forward to ...

    72. Spring MVC model access in jsp failed    forum.springsource.org

    Spring MVC model access in jsp failed Hi all, I am new to Spring. I created a simple maven project (no archetype) in eclipse and tested spring mvc by resembling the ...

    73. Simple question - access object in jsp passed from modelAndView    forum.springsource.org

    Hi all! I just need to access object, doplnokList which is LinkedList, passed from controller method [...] return new ModelAndView("hello","doplnokList",doplnokList); to jsp page and access it in <% %> tag. Perhaps ...

    74. Unable to access modelAndView attributes in JSP without JSTL.    forum.springsource.org

    Unable to access modelAndView attributes in JSP without JSTL. Iam new to spring and using spring 3.0. I have added some attribute/object in my modelAndView object. Eg: ModelAndView mav = new ...

    75. Authorizing Custom Roles in .jsp Page    forum.springsource.org

    Hey All, I've got a ITEM_OWNED_BY_CURRENT_USER role voter, and I'd like to display a delete submit button in the item's details page if the current user owns the item. How do ...

    76. after authentication, keeps going back to /login.jsp    forum.springsource.org

    after authentication, keeps going back to /login.jsp Hi, I am having problems after login, it does not go to index.jsp but instead keeps going back to /login.jsp. Guess must be something ...

    77. Bind jsp user entry to end level object in object graph    forum.springsource.org

    Bind jsp user entry to end level object in object graph Hello, I am not sure how I can do spring bind for the following case : I have a object ...

    78. access to value of radio button in jsp page    forum.springsource.org

    access to value of radio button in jsp page hi! I have a tree. each node is a directory. (like the windows explorer tree) and in front of each node I ...

    79. Access key-values jdom doc passed by model in a jsp view.    forum.springsource.org

    Access key-values jdom doc passed by model in a jsp view. Hello, I've got to access data in the form of key-value i.e a map in a view implemented by a ...

    80. Access PropertyPlaceholderConfigurer in JSP    forum.springsource.org

    The PropertyPlaceholderConfigurer is implemented as a bean factory post-processor. It gets a callback from the BeanFactory after any initialization methods are called and is used to externalize some property values from ...

    81. Access a bean from Jsp    forum.springsource.org

    Access a bean from Jsp Hi all, I'm doing a prototype with the purpose of evaluate Spring for using in our company. The prototype is being developed on Spring 1.2, Struts ...

    82. Problem in Acegi Sample/add.jsp    forum.springsource.org

    Problem in Acegi Sample/add.jsp Hello, i have a li problem. When I want to add an user in the Sample App and click on the add-link, I get this error: javax.servlet.ServletException: ...

    83. Can't access model from JSP    forum.springsource.org

    Sep 17th, 2005, 12:47 PM #1 juzzam View Profile View Forum Posts Private Message Junior Member Join Date Sep 2005 Posts 2 Can't access model from JSP I'm new to spring ...

    84. using acegi Authz(JSP tag) in velocity template (w/ sample)    forum.springsource.org

    using acegi Authz(JSP tag) in velocity template (w/ sample) When I try to use acegi at my recent project. I find that it's JSP tag prevent me from using velocity template ...

    85. prevent direct access to .jsp pages    forum.springsource.org

    prevent direct access to .jsp pages Is it possible to prevent direct access to .jsp pages even after the user has been authenticated. For example, I want to prevent the user ...

    86. How to access static constant variables from jsp pages.    forum.springsource.org

    We have a class for holding public static final String values in it, for using it in jsp files what is the preferred way? is using directly as a scriplet <%=Blah.MY_CONSTANT ...

    87. How to deny a direct access to jsp pages?    forum.springsource.org

    How to deny a direct access to jsp pages? Hi everybody! This is my first post here... I'm building a web application using Spring MVC and i'd like to forbid a ...

    88. How to secure query strings like http://host/view_interview.jsp?interview_id=10234    forum.springsource.org

    A user who logged in can view his order from http://host/view_order.jsp?orderId=10234 The permission should only be granted if the order 10234 is created by this user, if order 19238 is created ...

    89. XP permissions? ant via eclipse will not localhost deploy index.jsp    forum.springsource.org

    Hello All, I am working through the tutorial... http://www.springframework.org/docs/...ep-Part-1.html ...and see via Ant Run console will display successfull completion, no files are moved. Paths look good, filemon indicates no permissions issues--but ...

    90. I thought I could assign ROLE_ANONYMOUS to my login.jsp file?    forum.springsource.org

    I thought I could assign ROLE_ANONYMOUS to my login.jsp file? I thought I could assign ROLE_ANONYMOUS to my login.jsp file? I've been reading Chapter 14. Anonymous Authentication and I guess I ...

    91. access bean data from jsp containing a form    forum.springsource.org

    access bean data from jsp containing a form Hello, I'm new to Spring and currently a bit lost. I would appreciate your help. In an MVC application I configured a bean ...

    92. JSP field level security with Authorization Tags    forum.springsource.org

    JSP field level security with Authorization Tags Hi All, We have a requirement of field level security on our JSPs. For example there is a field "Address" which is editable for ...

    93. Acegi+Sitemesh jsp ErrorPage is blank    forum.springsource.org

    Acegi+Sitemesh jsp ErrorPage is blank Hi All: I use acegi, sitemesh filter in my wabapp. This is my configration. web.xml Code: AcegiFilter org.acegisecurity.util.FilterToBeanProxy targetClass ...

    94. how to access JSTL variables in JSP    forum.springsource.org

    Hi Can anyone tell me how to extract JSTL variables in scriptlet tag of JSP How to extract it in HTML or JSP?? Thanks in advance.

    95. The requested resource /springmvc/jsp/acegi/j_acegi_security_check is not available    forum.springsource.org

    Feb 7th, 2007, 06:59 PM #1 muthiahmerchant View Profile View Forum Posts Private Message Member Join Date Feb 2007 Posts 72 The requested resource /springmvc/jsp/acegi/j_acegi_security_check is not available Hi all, I ...

    96. acegi and jsp's    forum.springsource.org

    acegi and jsp's I am using acegi 1.0.3 with spring 2.0.4 on weblogic 8.1. I have configured form login security from the sample config code. Now i am trying to marry ...

    97. Strange problem: JSP Spring MVC: Access to JAVA Methods    forum.springsource.org

    Strange problem: JSP Spring MVC: Access to JAVA Methods Hello, I have a really ugly problem and I don't know if it's my fault or just a bug in the framework. ...

    98. Securing multiple view options in single JSP page    forum.springsource.org

    Securing multiple view options in single JSP page I have a situation which is confusing me that how can i use acegi to make things simple for jsp views and apply ...

    99. How to access css/js files in jsps, all of them are placed in WEB-INF??    forum.springsource.org

    Hello, I have the following structure for my project: Code: My_Proj WEB-INF jsps js css images Now when i am accessing the jsp page via controller mechanism, the javascript and css ...

    100. securing direct JSP access    forum.springsource.org

    Hi All, What's the best strategy to secure my site so that users can't directly access any *.jsp pages (ie - they can only access the spring *.htm controller mappings)? I'm ...