@@ -1727,33 +1727,36 @@ else if (!DispatcherType.REQUEST.equals(baseRequest.getDispatcherType()))
1727
1727
if (isUsingURLs () && (requestedSessionId == null ))
1728
1728
{
1729
1729
String uri = request .getRequestURI ();
1730
- String prefix = getSessionIdPathParameterNamePrefix ();
1731
- if (prefix != null )
1730
+ if (uri != null )
1732
1731
{
1733
- int s = uri . indexOf ( prefix );
1734
- if (s >= 0 )
1732
+ String prefix = getSessionIdPathParameterNamePrefix ( );
1733
+ if (prefix != null )
1735
1734
{
1736
- s += prefix .length ();
1737
- int i = s ;
1738
- while (i < uri .length ())
1735
+ int s = uri .indexOf (prefix );
1736
+ if (s >= 0 )
1739
1737
{
1740
- char c = uri .charAt (i );
1741
- if (c == ';' || c == '#' || c == '?' || c == '/' )
1742
- break ;
1743
- i ++;
1744
- }
1738
+ s += prefix .length ();
1739
+ int i = s ;
1740
+ while (i < uri .length ())
1741
+ {
1742
+ char c = uri .charAt (i );
1743
+ if (c == ';' || c == '#' || c == '?' || c == '/' )
1744
+ break ;
1745
+ i ++;
1746
+ }
1745
1747
1746
- requestedSessionId = uri .substring (s , i );
1747
- requestedSessionIdFromCookie = false ;
1748
+ requestedSessionId = uri .substring (s , i );
1749
+ requestedSessionIdFromCookie = false ;
1748
1750
1749
- if (LOG .isDebugEnabled ())
1750
- LOG .debug ("Got Session ID {} from URL" , requestedSessionId );
1751
+ if (LOG .isDebugEnabled ())
1752
+ LOG .debug ("Got Session ID {} from URL" , requestedSessionId );
1751
1753
1752
- session = getHttpSession (requestedSessionId );
1753
- if (session != null && isValid (session ))
1754
- {
1755
- baseRequest .enterSession (session ); //request enters this session for first time
1756
- baseRequest .setSession (session ); //associate the session with the request
1754
+ session = getHttpSession (requestedSessionId );
1755
+ if (session != null && isValid (session ))
1756
+ {
1757
+ baseRequest .enterSession (session ); //request enters this session for first time
1758
+ baseRequest .setSession (session ); //associate the session with the request
1759
+ }
1757
1760
}
1758
1761
}
1759
1762
}
0 commit comments