Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
e0afb12d
Commit
e0afb12d
authored
5 years ago
by
Mandar Ambawane
Committed by
nixonrodrigues
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3472 :- Fix to port jsp's to Servlet.
Signed-off-by:
nixonrodrigues
<
nixon@apache.org
>
parent
d57f5d8a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
160 additions
and
20 deletions
+160
-20
AtlasErrorServlet.java
...java/org/apache/atlas/web/servlets/AtlasErrorServlet.java
+35
-0
AtlasHttpServlet.java
.../java/org/apache/atlas/web/servlets/AtlasHttpServlet.java
+48
-0
AtlasLoginServlet.java
...java/org/apache/atlas/web/servlets/AtlasLoginServlet.java
+36
-0
spring-security.xml
webapp/src/main/resources/spring-security.xml
+1
-0
web.xml
webapp/src/main/webapp/WEB-INF/web.xml
+20
-0
error.html.template
webapp/src/main/webapp/error.html.template
+0
-0
login.html.template
webapp/src/main/webapp/login.html.template
+20
-20
No files found.
webapp/src/main/java/org/apache/atlas/web/servlets/AtlasErrorServlet.java
0 → 100644
View file @
e0afb12d
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
web
.
servlets
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
public
class
AtlasErrorServlet
extends
AtlasHttpServlet
{
public
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
AtlasErrorServlet
.
class
);
public
static
final
String
ERROR_HTML_TEMPLATE
=
"/error.html.template"
;
@Override
protected
void
service
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
includeResponse
(
request
,
response
,
ERROR_HTML_TEMPLATE
);
}
}
This diff is collapsed.
Click to expand it.
webapp/src/main/java/org/apache/atlas/web/servlets/AtlasHttpServlet.java
0 → 100644
View file @
e0afb12d
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
web
.
servlets
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
javax.servlet.RequestDispatcher
;
import
javax.servlet.ServletContext
;
import
javax.servlet.http.HttpServlet
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
public
class
AtlasHttpServlet
extends
HttpServlet
{
public
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
AtlasHttpServlet
.
class
);
public
static
final
String
TEXT_HTML
=
"text/html"
;
public
static
final
String
XFRAME_OPTION
=
"X-Frame-Options"
;
public
static
final
String
DENY
=
"DENY"
;
protected
void
includeResponse
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
template
)
{
try
{
response
.
setContentType
(
TEXT_HTML
);
response
.
setHeader
(
XFRAME_OPTION
,
DENY
);
ServletContext
context
=
getServletContext
();
RequestDispatcher
rd
=
context
.
getRequestDispatcher
(
template
);
rd
.
include
(
request
,
response
);
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Error in AtlasHttpServlet"
,
template
,
e
);
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
webapp/src/main/java/org/apache/atlas/web/servlets/AtlasLoginServlet.java
0 → 100644
View file @
e0afb12d
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
web
.
servlets
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
public
class
AtlasLoginServlet
extends
AtlasHttpServlet
{
public
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
AtlasLoginServlet
.
class
);
public
static
final
String
LOGIN_HTML_TEMPLATE
=
"/login.html.template"
;
@Override
protected
void
service
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
includeResponse
(
request
,
response
,
LOGIN_HTML_TEMPLATE
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
webapp/src/main/resources/spring-security.xml
View file @
e0afb12d
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
<!-- This XML is no longer being used, @see AtlasSecurityConfig for the equivalent java config -->
<!-- This XML is no longer being used, @see AtlasSecurityConfig for the equivalent java config -->
<security:http
pattern=
"/login.jsp"
security=
"none"
/>
<security:http
pattern=
"/login.jsp"
security=
"none"
/>
<security:http
pattern=
"/error.jsp"
security=
"none"
/>
<security:http
pattern=
"/css/**"
security=
"none"
/>
<security:http
pattern=
"/css/**"
security=
"none"
/>
<security:http
pattern=
"/img/**"
security=
"none"
/>
<security:http
pattern=
"/img/**"
security=
"none"
/>
<security:http
pattern=
"/libs/**"
security=
"none"
/>
<security:http
pattern=
"/libs/**"
security=
"none"
/>
...
...
This diff is collapsed.
Click to expand it.
webapp/src/main/webapp/WEB-INF/web.xml
View file @
e0afb12d
...
@@ -36,6 +36,26 @@
...
@@ -36,6 +36,26 @@
<load-on-startup>
1
</load-on-startup>
<load-on-startup>
1
</load-on-startup>
</servlet>
</servlet>
<servlet>
<servlet-name>
LoginServlet
</servlet-name>
<servlet-class>
org.apache.atlas.web.servlets.AtlasLoginServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>
LoginServlet
</servlet-name>
<url-pattern>
/login.jsp
</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>
ErrorServlet
</servlet-name>
<servlet-class>
org.apache.atlas.web.servlets.AtlasErrorServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>
ErrorServlet
</servlet-name>
<url-pattern>
/error.jsp
</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-mapping>
<servlet-name>
jersey-servlet
</servlet-name>
<servlet-name>
jersey-servlet
</servlet-name>
<url-pattern>
/api/atlas/*
</url-pattern>
<url-pattern>
/api/atlas/*
</url-pattern>
...
...
This diff is collapsed.
Click to expand it.
webapp/src/main/webapp/error.
jsp
→
webapp/src/main/webapp/error.
html.template
View file @
e0afb12d
File moved
This diff is collapsed.
Click to expand it.
webapp/src/main/webapp/login.
jsp
→
webapp/src/main/webapp/login.
html.template
View file @
e0afb12d
...
@@ -15,12 +15,11 @@
...
@@ -15,12 +15,11 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
-->
-->
<
%
response
.
setHeader
("
X-Frame-Options
",
"
DENY
");
%
>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if lt IE 9]>
<!--[if lt IE 9]>
<script type="text/javascript">
<script type="text/javascript">
function Redirect() {
function Redirect() {
window.location.assign("ieerror.html");
window.location.assign("ieerror.html");
}
}
...
@@ -28,8 +27,8 @@
...
@@ -28,8 +27,8 @@
</script>
</script>
<![endif]-->
<![endif]-->
<!--[if gt IE 7]>
<!--[if gt IE 7]>
<script src="js/external_lib/es5-shim.min.js"></script>
<script src="js/external_lib/es5-shim.min.js"></script>
<script src="js/external_lib/respond.min.js"></script>
<script src="js/external_lib/respond.min.js"></script>
<![endif]-->
<![endif]-->
<!--[if gt IE 8]><!-->
<!--[if gt IE 8]><!-->
<html
class=
"no-js"
>
<html
class=
"no-js"
>
...
@@ -50,23 +49,23 @@
...
@@ -50,23 +49,23 @@
</head>
</head>
<body
class=
"login-body"
>
<body
class=
"login-body"
>
<div
class=
"login-form"
>
<div
class=
"login-form"
>
<div
class=
"logo-container text-center"
>
<div
class=
"logo-container text-center"
>
<img
src=
"img/atlas_logo.svg"
/>
<img
src=
"img/atlas_logo.svg"
/>
</div>
<h4>
Sign In to your account
</h4>
<form
action=
""
method=
"post"
accept-charset=
"utf-8"
>
<div
class=
"form-group icon-group user"
>
<input
type=
"text"
name=
"username"
id=
"username"
class=
"form-control"
placeholder=
"Username"
tabindex=
"1"
required
autofocus
/>
</div>
<div
class=
"form-group icon-group password"
>
<input
type=
"password"
name=
"password"
class=
"form-control"
placeholder=
"Password"
id=
"password"
tabindex=
"2"
autocomplete=
"off"
required
/>
<i
class=
"fa fa-eye-slash show-password"
></i>
</div>
<span
id=
"errorBox"
class=
"col-md-12 help-inline"
style=
"color:#FF1A40;display:none;text-align:center;padding-bottom: 10px;"
><span
class=
"errorMsg"
></span></span>
<button
class=
"btn btn-default btn-block btn-login"
id=
"signIn"
>
Log in
</button>
</form>
</div>
</div>
<h4>
Sign In to your account
</h4>
<form
action=
""
method=
"post"
accept-charset=
"utf-8"
>
<div
class=
"form-group icon-group user"
>
<input
type=
"text"
name=
"username"
id=
"username"
class=
"form-control"
placeholder=
"Username"
tabindex=
"1"
required
autofocus
/>
</div>
<div
class=
"form-group icon-group password"
>
<input
type=
"password"
name=
"password"
class=
"form-control"
placeholder=
"Password"
id=
"password"
tabindex=
"2"
autocomplete=
"off"
required
/>
<i
class=
"fa fa-eye-slash show-password"
></i>
</div>
<span
id=
"errorBox"
class=
"col-md-12 help-inline"
style=
"color:#FF1A40;display:none;text-align:center;padding-bottom: 10px;"
><span
class=
"errorMsg"
></span></span>
<button
class=
"btn btn-default btn-block btn-login"
id=
"signIn"
>
Log in
</button>
</form>
</div>
</body>
</body>
</html>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment