perfsonar-dev - perfsonar: r5393 - in branches/new-structure-with-base2/ps-mdm-web-admin: src/main/java/org/perfsonar/webadmin/base2/servlet src/main/java/org/perfsonar/webadmin/base2/servlet/util tomcat/html
Subject: perfsonar development work
List archive
perfsonar: r5393 - in branches/new-structure-with-base2/ps-mdm-web-admin: src/main/java/org/perfsonar/webadmin/base2/servlet src/main/java/org/perfsonar/webadmin/base2/servlet/util tomcat/html
Chronological Thread
- From:
- To:
- Subject: perfsonar: r5393 - in branches/new-structure-with-base2/ps-mdm-web-admin: src/main/java/org/perfsonar/webadmin/base2/servlet src/main/java/org/perfsonar/webadmin/base2/servlet/util tomcat/html
- Date: Wed, 9 Dec 2009 07:54:38 -0500
Author: trzaszcz
Date: 2009-12-09 07:54:38 -0500 (Wed, 09 Dec 2009)
New Revision: 5393
Modified:
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/servlet/BasicConfigurationServlet.java
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/servlet/util/ConfigurationServletHelper.java
branches/new-structure-with-base2/ps-mdm-web-admin/tomcat/html/index.jsp
Log:
jsp view improved
Modified:
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/servlet/BasicConfigurationServlet.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/servlet/BasicConfigurationServlet.java
2009-12-09 12:16:01 UTC (rev 5392)
+++
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/servlet/BasicConfigurationServlet.java
2009-12-09 12:54:38 UTC (rev 5393)
@@ -45,7 +45,14 @@
ConfigurationServletHelper config=new
ConfigurationServletHelper(request, response, getServletContext());
logger.info("WA --- DO WRITE");
- config.processData();
+
+ String urlPath="index.jsp?page=save";
+
+ if(config.processData()){
+ urlPath+="&ok";
+ }
+
+ response.sendRedirect(urlPath);
}
Modified:
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/servlet/util/ConfigurationServletHelper.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/servlet/util/ConfigurationServletHelper.java
2009-12-09 12:16:01 UTC (rev 5392)
+++
branches/new-structure-with-base2/ps-mdm-web-admin/src/main/java/org/perfsonar/webadmin/base2/servlet/util/ConfigurationServletHelper.java
2009-12-09 12:54:38 UTC (rev 5393)
@@ -6,6 +6,7 @@
import java.util.logging.Logger;
import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
@@ -127,12 +128,21 @@
}
@SuppressWarnings("unchecked")
- public void processData() {
+ public boolean processData() {
+ boolean saved=false;
logger.info("WA --- Processing client data.");
objectMap().updateObjects(request.getParameterMap());
- objectMap().save();
+ if(objectMap().save()){
+ logger.info("configuration saved");
+ saved=true;
+ }else{
+ logger.info("problem with saving configuration");
+ saved=false;
+ }
logger.info("Done processing client data.");
displayPage(getHttpParameter("form_key"));
+
+ return saved;
}
public boolean authenticate(Map<String, String> userpass) {
@@ -214,8 +224,13 @@
}
}
- @SuppressWarnings("unused")
- private void forward(String url) throws Exception {
- context.getRequestDispatcher(url).forward(request, response);
+ public void forward(String url){
+ try {
+ context.getRequestDispatcher(url).forward(request,
response);
+ } catch (ServletException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
}
};
Modified:
branches/new-structure-with-base2/ps-mdm-web-admin/tomcat/html/index.jsp
===================================================================
--- branches/new-structure-with-base2/ps-mdm-web-admin/tomcat/html/index.jsp
2009-12-09 12:16:01 UTC (rev 5392)
+++ branches/new-structure-with-base2/ps-mdm-web-admin/tomcat/html/index.jsp
2009-12-09 12:54:38 UTC (rev 5393)
@@ -1,17 +1,4 @@
-<%!
- public void jspInit()
- {
- super.jspInit();
-
org.perfsonar.webadmin.base2.servlet.util.Abstraction.objectMap(getServletContext());
- }
-
- public void jspDestroy()
- {
- super.jspDestroy();
- }
-%>
-
-<html>
+<%@page
import="org.perfsonar.webadmin.base2.servlet.util.ConfigurationServletHelper"%><html>
<head>
<title>perfSONAR Service Web Administration page</title>
<link rel="stylesheet" type="text/css" href="main.css"/>
@@ -65,12 +52,9 @@
<body>
<%
- org.perfsonar.webadmin.base2.config.ObjectMap map =
-
org.perfsonar.webadmin.base2.
-
servlet.util.Abstraction.
-
objectMap(getServletContext());
-
+ org.perfsonar.webadmin.base2.config.ObjectMap map =
ConfigurationServletHelper.objectMap(getServletContext());
if( map == null )
+
{
%>
<center>
@@ -89,36 +73,33 @@
</body>
</html>
<%
- return;
- }
- String save = request.getParameter("page");
- if( save != null && save.equals("save") &&
map.needSync() )
- {
- if( map.save() )
- {
+ return;
+ }
+ System.out.println("------------------------------------");
+ String save = request.getParameter("page");
+ System.out.println("page :"+save);
+ if( save != null && save.equals("save")){
+ if( request.getParameter("ok")!=null ) {
%>
- <p class="heading1">
- The configuration files have been saved.
- </p>
+ <p class="heading1">
+ The configuration files have been saved.
+ </p>
<%
- }
- else
- {
+ System.out.println("if");
+ }else{
+ System.out.println("Else");
%>
- <p class="heading1">
- An error occurred while saving te configuration files.
- Please check Tomcat log files for
further information.
- </p>
+ <p class="heading1">
+ An error occurred while saving te
configuration files.
+ Please check Tomcat
log files for further information.
+ </p>
<%
}
- }
-
- String[] smallLinks =
- org.perfsonar.webadmin.base2.config.
- HTMLGenerator.makeLinks(map,false);
+ }
+ String[] smallLinks
=org.perfsonar.webadmin.base2.config.HTMLGenerator.makeLinks(map,false);
%>
<div class="adminPanel">
<div class="banner">
- perfsonar: r5393 - in branches/new-structure-with-base2/ps-mdm-web-admin: src/main/java/org/perfsonar/webadmin/base2/servlet src/main/java/org/perfsonar/webadmin/base2/servlet/util tomcat/html, svnlog, 12/09/2009
Archive powered by MHonArc 2.6.16.