commit 정리
This commit is contained in:
parent
47ef6eb778
commit
a280ea8c7b
@ -1,95 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!-- uac.service.board.qna_GET.xml -->
|
||||
<result>
|
||||
<code>S</code>
|
||||
<message>성공적으로 조회되었습니다.</message>
|
||||
<records>10</records>
|
||||
<page>1</page>
|
||||
<totPages>15</totPages>
|
||||
<record>
|
||||
<noticeNo>1</noticeNo>
|
||||
<noticeType>101</noticeType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>15</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</record>
|
||||
<record>
|
||||
<noticeNo>2</noticeNo>
|
||||
<noticeType>101</noticeType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</record>
|
||||
<record>
|
||||
<noticeNo>3</noticeNo>
|
||||
<noticeType>101</noticeType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</record>
|
||||
<record>
|
||||
<noticeNo>4</noticeNo>
|
||||
<noticeType>101</noticeType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</record>
|
||||
<record>
|
||||
<noticeNo>5</noticeNo>
|
||||
<noticeType>101</noticeType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</record>
|
||||
<record>
|
||||
<noticeNo>6</noticeNo>
|
||||
<noticeType>101</noticeType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</record>
|
||||
<record>
|
||||
<noticeNo>7</noticeNo>
|
||||
<noticeType>101</noticeType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</record>
|
||||
<record>
|
||||
<noticeNo>8</noticeNo>
|
||||
<noticeType>101</noticeType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</record>
|
||||
<record>
|
||||
<noticeNo>9</noticeNo>
|
||||
<noticeType>101</noticeType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</record>
|
||||
<record>
|
||||
<noticeNo>10</noticeNo>
|
||||
<noticeType>101</noticeType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</record>
|
||||
<record>
|
||||
<noticeNo>11</noticeNo>
|
||||
<noticeType>101</noticeType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</record>
|
||||
<record>
|
||||
<noticeNo>12</noticeNo>
|
||||
<noticeType>101</noticeType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</record>
|
||||
<end>3333</end>
|
||||
</result>
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!-- uac.service.board.qna_GET.xml -->
|
||||
<result>
|
||||
<page>1</page>
|
||||
<totPages>15</totPages>
|
||||
<records>125</records>
|
||||
<results>
|
||||
<articleNo>1</articleNo>
|
||||
<articleType>101</articleType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>15</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</results>
|
||||
<results>
|
||||
<articleNo>2</articleNo>
|
||||
<articleType>101</articleType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</results>
|
||||
<results>
|
||||
<articleNo>3</articleNo>
|
||||
<articleType>101</articleType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</results>
|
||||
<results>
|
||||
<articleNo>4</articleNo>
|
||||
<articleType>101</articleType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</results>
|
||||
<results>
|
||||
<articleNo>5</articleNo>
|
||||
<articleType>101</articleType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</results>
|
||||
<results>
|
||||
<articleNo>6</articleNo>
|
||||
<articleType>101</articleType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</results>
|
||||
<results>
|
||||
<articleNo>7</articleNo>
|
||||
<articleType>101</articleType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</results>
|
||||
<results>
|
||||
<articleNo>8</articleNo>
|
||||
<articleType>101</articleType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</results>
|
||||
<results>
|
||||
<articleNo>9</articleNo>
|
||||
<articleType>101</articleType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</results>
|
||||
<results>
|
||||
<articleNo>10</articleNo>
|
||||
<articleType>101</articleType>
|
||||
<title>공지사항 테스트</title>
|
||||
<readCount>55</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
</results>
|
||||
</result>
|
||||
|
||||
|
||||
41
data/dataxml/uac.service.board.qna_GET.xml
Normal file
41
data/dataxml/uac.service.board.qna_GET.xml
Normal file
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!-- uac.service.board.qna_GET.xml -->
|
||||
<result>
|
||||
<!-- 상세내용 -->
|
||||
<articleNo>5</articleNo>
|
||||
<articleType>101</articleType>
|
||||
<title>공지사항 테스트</title>
|
||||
<articlePassword>111</articlePassword>
|
||||
<readCount>15</readCount>
|
||||
<regDate>2021-07-19</regDate>
|
||||
<regUserName>김아무</regUserName>
|
||||
<repStatus>답변완료</repStatus>
|
||||
<email>myid@digitalship.co.kr</email>
|
||||
<contentQeust>질문이 있습니다.</contentQeust>
|
||||
<contentQeustFile>111111=화면캡쳐.jpg;222222=화면캡쳐2.jpg;</contentQeustFile>
|
||||
<contentReply>이렇게 답변 드립니다.</contentReply>
|
||||
<contentReplyFile>333333=결과확인.jpg;</contentReplyFile>
|
||||
|
||||
<!-- 이전글, 다음글 -->
|
||||
<page>1</page>
|
||||
<totPages>1</totPages>
|
||||
<records>2</records>
|
||||
<results>
|
||||
<articleNo>4</articleNo>
|
||||
<articleType>101</articleType>
|
||||
<title>이전의 글제목입니다.</title>
|
||||
<regDate>2021-07-19</regDate>
|
||||
<regUserName>김아무</regUserName>
|
||||
<repStatus>답변완료</repStatus>
|
||||
</results>
|
||||
<results>
|
||||
<articleNo>6</articleNo>
|
||||
<articleType>102</articleType>
|
||||
<title>다음의 글제목입니다.</title>
|
||||
<regDate>2021-07-20</regDate>
|
||||
<regUserName>홍아무</regUserName>
|
||||
<repStatus>답변완료</repStatus>
|
||||
</results>
|
||||
|
||||
</result>
|
||||
|
||||
7
data/dataxml/uac.service.board.qna_POST.xml
Normal file
7
data/dataxml/uac.service.board.qna_POST.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!-- uac.service.board.qna_POST.xml -->
|
||||
<result>
|
||||
<!-- 상세내용 -->
|
||||
<articleNo>10</articleNo>
|
||||
</result>
|
||||
|
||||
7
data/dataxml/uac.service.board.qna_PUT.xml
Normal file
7
data/dataxml/uac.service.board.qna_PUT.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!-- uac.service.board.qna_PUT.xml -->
|
||||
<result>
|
||||
<!-- 상세내용 -->
|
||||
<articleNo>10</articleNo>
|
||||
</result>
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!-- uac.service.exports.xml -->
|
||||
<result>
|
||||
<userId>admin@digitalship.coom</userId>
|
||||
<userName>홍길동</userName>
|
||||
<password>XohImNooBHFR0OVvjcYpJ3NgPQ1qq73WKhHvch0VQtg=</password>
|
||||
<uniqId>100000001</uniqId>
|
||||
<authorities>ROLE_USER,ROLE_ADMIN</authorities>
|
||||
</result>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!-- uac.service.exports.xml -->
|
||||
<result>
|
||||
<userId>admin@digitalship.coom</userId>
|
||||
<userName>홍길동</userName>
|
||||
<password>XohImNooBHFR0OVvjcYpJ3NgPQ1qq73WKhHvch0VQtg=</password>
|
||||
<uniqId>100000001</uniqId>
|
||||
<authorities>ROLE_USER,ROLE_ADMIN</authorities>
|
||||
</result>
|
||||
|
||||
@ -1,239 +1,239 @@
|
||||
package nlib.restful.service;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.stream.XMLEventReader;
|
||||
import javax.xml.stream.XMLInputFactory;
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
import javax.xml.stream.events.StartElement;
|
||||
import javax.xml.stream.events.XMLEvent;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import nlib.sample.web.SampleEncoderController;
|
||||
import nlib.util.StringUtil;
|
||||
|
||||
public class XmlConverter {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(XmlConverter.class);
|
||||
|
||||
public static HashMap<String, Object> convert(String xmlStr) throws Exception {
|
||||
|
||||
if(xmlStr == null) return null;
|
||||
|
||||
ByteArrayInputStream bIn = new ByteArrayInputStream(xmlStr.getBytes());
|
||||
HashMap<String, Object> resMap = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
|
||||
XMLEventReader eventReader = inputFactory.createXMLEventReader(bIn);
|
||||
|
||||
resMap = getElementValue("result", eventReader, null);
|
||||
log.debug("Converting XML to HashMap : Done >> " + resMap);
|
||||
} catch (XMLStreamException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return resMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rootElementName
|
||||
* @param eventReader
|
||||
* @param alreadyRootOpened : 부모 요소 찾기 없이 작업 진행할지 여부. false인 경우, rootElementName 요소를 찾아서 이후 값 추출 수행
|
||||
* @param startElement
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static HashMap<String, Object> getElementValue(
|
||||
String rootElementName
|
||||
, XMLEventReader eventReader
|
||||
, XMLEvent firstChildElement) throws Exception {
|
||||
|
||||
HashMap<String, Object> retMap = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
|
||||
int depth = (firstChildElement == null ? 0 : 1);
|
||||
StartElement startElement = null;
|
||||
|
||||
XMLEvent event = firstChildElement;
|
||||
|
||||
String upperElementName = null;
|
||||
String elementName = null; //(firstChildElement == null ? null : firstChildElement.asStartElement().getName().getLocalPart());
|
||||
String content = null;
|
||||
String elementValue = "";
|
||||
HashMap<String, String> elementValues = null;
|
||||
boolean hasSubElements = false;
|
||||
boolean isFirst = true;
|
||||
|
||||
while (eventReader.hasNext()) {
|
||||
|
||||
// 이벤트가 함께 매개변수로 넘어온 경우, 처음 읽기 생략
|
||||
if(!isFirst || event == null) {
|
||||
event = eventReader.nextEvent();
|
||||
}
|
||||
|
||||
if(isFirst) isFirst = false;
|
||||
|
||||
|
||||
// 1 레벨 엘리먼트 찾기
|
||||
if (depth == 0 && event.isStartElement() && event.asStartElement().getName().getLocalPart().equals(rootElementName)) {
|
||||
depth++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// 1 레벨 엘리먼트내의 2 레벨 엘리먼트 찾기
|
||||
if(depth == 1 && elementName == null && event.isStartElement()) {
|
||||
elementName = event.asStartElement().getName().getLocalPart();
|
||||
elementValue = "";
|
||||
elementValues = null;
|
||||
hasSubElements = false;
|
||||
depth++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// 2 레벨 엘리먼트 내용 찾기
|
||||
if(depth == 2 && elementName != null && event.isCharacters()) {
|
||||
content = event.asCharacters().getData();
|
||||
if(StringUtil.isNotEmpty(content)) {
|
||||
elementValue += content;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// 2 레벨 엘리먼트 종료
|
||||
if(depth == 2 && elementName != null && event.isEndElement()) {
|
||||
|
||||
if(!elementName.equals(event.asEndElement().getName().getLocalPart())) {
|
||||
throw new Exception("XML문의 요소 시작/종료 태그가 일치하지 않습니다. : " + elementName + " 요소가 " + event.asEndElement().getName().getLocalPart() + "로 종료되었습니다.");
|
||||
}
|
||||
|
||||
addValue(retMap, elementName, elementValue);
|
||||
System.out.println(elementName + " : -" + elementValue + "_");
|
||||
|
||||
elementName = null;
|
||||
elementValue = "";
|
||||
depth--;
|
||||
}
|
||||
|
||||
// 2 레벨 엘리먼트 > 하위 엘리먼트 존재하는 경우
|
||||
if(depth == 2 && elementName != null && event.isStartElement()) {
|
||||
HashMap<String, Object> subMap = getElementValue(elementName, eventReader, event);
|
||||
addValue(retMap, elementName, subMap);
|
||||
depth--;
|
||||
elementName = null;
|
||||
}
|
||||
|
||||
// 1 레벨 엘리먼트 종료된 경우, 돌아가기
|
||||
if(depth == 1 && elementName == null && event.isEndElement() && rootElementName.equals(event.asEndElement().getName().getLocalPart())) {
|
||||
depth--;
|
||||
return retMap;
|
||||
}
|
||||
|
||||
} // while
|
||||
|
||||
} catch (XMLStreamException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.out.println("END");
|
||||
return retMap;
|
||||
}
|
||||
|
||||
public static void addValue(HashMap<String, Object> map, String key, Object value) throws Exception {
|
||||
if(map == null) throw new Exception("값을 넣을 Map 변수가 초기화되지 않았습니다.");
|
||||
|
||||
if(key == null) return;
|
||||
if(value == null) return;
|
||||
|
||||
Object curValObj = map.get(key);
|
||||
if(curValObj == null) {
|
||||
map.put(key, value);
|
||||
return;
|
||||
}
|
||||
|
||||
if(curValObj instanceof String || curValObj instanceof HashMap) {
|
||||
List<Object> values = new ArrayList<Object>();
|
||||
values.add(curValObj);
|
||||
values.add(value);
|
||||
map.put(key, values);
|
||||
} else if(curValObj instanceof List) {
|
||||
((ArrayList<Object>)curValObj).add(value);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
public static void main(String argv[]) throws Exception {
|
||||
|
||||
XmlConverter xmlConverter = new XmlConverter();
|
||||
String xmlStr = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n" +
|
||||
"<!-- uac.service.board.qna_GET.xml -->\r\n" +
|
||||
"<result>\r\n" +
|
||||
" <code>S</code>\r\n" +
|
||||
" <message>성공적으로 조회되었습니다.</message>\r\n" +
|
||||
" <records>10</records>\r\n" +
|
||||
" <page>1</page>\r\n" +
|
||||
" <totPages>15</totPages>\r\n" +
|
||||
" <record>\r\n" +
|
||||
" <noticeNo>1</noticeNo>\r\n" +
|
||||
" <noticeType>101</noticeType>\r\n" +
|
||||
" <title>공지사항 테스트</title>\r\n" +
|
||||
" <readCount>15</readCount>\r\n" +
|
||||
" <regDate>2021-07-19</regDate>\r\n" +
|
||||
" </record>\r\n" +
|
||||
" <record>\r\n" +
|
||||
" <noticeNo>2</noticeNo>\r\n" +
|
||||
" <noticeType>101</noticeType>\r\n" +
|
||||
" <title>공지사항 테스트</title>\r\n" +
|
||||
" <readCount>55</readCount>\r\n" +
|
||||
" <regDate>2021-07-19</regDate>\r\n" +
|
||||
" </record>\r\n" +
|
||||
" <record>\r\n" +
|
||||
" <noticeNo>3</noticeNo>\r\n" +
|
||||
" <noticeType>101</noticeType>\r\n" +
|
||||
" <title>공지사항 테스트</title>\r\n" +
|
||||
" <readCount>55</readCount>\r\n" +
|
||||
" <regDate>2021-07-19</regDate>\r\n" +
|
||||
" </record>\r\n" +
|
||||
" <record>\r\n" +
|
||||
" <noticeNo>4</noticeNo>\r\n" +
|
||||
" <noticeType>101</noticeType>\r\n" +
|
||||
" <title>공지사항 테스트</title>\r\n" +
|
||||
" <readCount>55</readCount>\r\n" +
|
||||
" <regDate>2021-07-19</regDate>\r\n" +
|
||||
" </record>\r\n" +
|
||||
" <record>\r\n" +
|
||||
" <noticeNo>5</noticeNo>\r\n" +
|
||||
" <noticeType>101</noticeType>\r\n" +
|
||||
" <title>공지사항 테스트</title>\r\n" +
|
||||
" <readCount>55</readCount>\r\n" +
|
||||
" <regDate>2021-07-19</regDate>\r\n" +
|
||||
" </record>\r\n" +
|
||||
" <record>\r\n" +
|
||||
" <noticeNo>6</noticeNo>\r\n" +
|
||||
" <noticeType>101</noticeType>\r\n" +
|
||||
" <title>공지사항 테스트</title>\r\n" +
|
||||
" <readCount>55</readCount>\r\n" +
|
||||
" <regDate>2021-07-19</regDate>\r\n" +
|
||||
" </record>\r\n" +
|
||||
" <end>3333</end>\r\n" +
|
||||
"</result>";
|
||||
|
||||
HashMap<String, Object> resMap = xmlConverter.convert(xmlStr);
|
||||
}
|
||||
*/
|
||||
}
|
||||
package nlib.restful.service;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.stream.XMLEventReader;
|
||||
import javax.xml.stream.XMLInputFactory;
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
import javax.xml.stream.events.StartElement;
|
||||
import javax.xml.stream.events.XMLEvent;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import nlib.sample.web.SampleEncoderController;
|
||||
import nlib.util.StringUtil;
|
||||
|
||||
public class XmlConverter {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(XmlConverter.class);
|
||||
|
||||
public static HashMap<String, Object> convert(String xmlStr) throws Exception {
|
||||
|
||||
if(xmlStr == null) return null;
|
||||
|
||||
ByteArrayInputStream bIn = new ByteArrayInputStream(xmlStr.getBytes());
|
||||
HashMap<String, Object> resMap = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
|
||||
XMLEventReader eventReader = inputFactory.createXMLEventReader(bIn);
|
||||
|
||||
resMap = getElementValue("result", eventReader, null);
|
||||
log.debug("Converting XML to HashMap : Done >> " + resMap);
|
||||
} catch (XMLStreamException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return resMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rootElementName
|
||||
* @param eventReader
|
||||
* @param alreadyRootOpened : 부모 요소 찾기 없이 작업 진행할지 여부. false인 경우, rootElementName 요소를 찾아서 이후 값 추출 수행
|
||||
* @param startElement
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static HashMap<String, Object> getElementValue(
|
||||
String rootElementName
|
||||
, XMLEventReader eventReader
|
||||
, XMLEvent firstChildElement) throws Exception {
|
||||
|
||||
HashMap<String, Object> retMap = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
|
||||
int depth = (firstChildElement == null ? 0 : 1);
|
||||
StartElement startElement = null;
|
||||
|
||||
XMLEvent event = firstChildElement;
|
||||
|
||||
String upperElementName = null;
|
||||
String elementName = null; //(firstChildElement == null ? null : firstChildElement.asStartElement().getName().getLocalPart());
|
||||
String content = null;
|
||||
String elementValue = "";
|
||||
HashMap<String, String> elementValues = null;
|
||||
boolean hasSubElements = false;
|
||||
boolean isFirst = true;
|
||||
|
||||
while (eventReader.hasNext()) {
|
||||
|
||||
// 이벤트가 함께 매개변수로 넘어온 경우, 처음 읽기 생략
|
||||
if(!isFirst || event == null) {
|
||||
event = eventReader.nextEvent();
|
||||
}
|
||||
|
||||
if(isFirst) isFirst = false;
|
||||
|
||||
|
||||
// 1 레벨 엘리먼트 찾기
|
||||
if (depth == 0 && event.isStartElement() && event.asStartElement().getName().getLocalPart().equals(rootElementName)) {
|
||||
depth++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// 1 레벨 엘리먼트내의 2 레벨 엘리먼트 찾기
|
||||
if(depth == 1 && elementName == null && event.isStartElement()) {
|
||||
elementName = event.asStartElement().getName().getLocalPart();
|
||||
elementValue = "";
|
||||
elementValues = null;
|
||||
hasSubElements = false;
|
||||
depth++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// 2 레벨 엘리먼트 내용 찾기
|
||||
if(depth == 2 && elementName != null && event.isCharacters()) {
|
||||
content = event.asCharacters().getData();
|
||||
if(StringUtil.isNotEmpty(content)) {
|
||||
elementValue += content;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// 2 레벨 엘리먼트 종료
|
||||
if(depth == 2 && elementName != null && event.isEndElement()) {
|
||||
|
||||
if(!elementName.equals(event.asEndElement().getName().getLocalPart())) {
|
||||
throw new Exception("XML문의 요소 시작/종료 태그가 일치하지 않습니다. : " + elementName + " 요소가 " + event.asEndElement().getName().getLocalPart() + "로 종료되었습니다.");
|
||||
}
|
||||
|
||||
addValue(retMap, elementName, elementValue);
|
||||
System.out.println(elementName + " : -" + elementValue + "_");
|
||||
|
||||
elementName = null;
|
||||
elementValue = "";
|
||||
depth--;
|
||||
}
|
||||
|
||||
// 2 레벨 엘리먼트 > 하위 엘리먼트 존재하는 경우
|
||||
if(depth == 2 && elementName != null && event.isStartElement()) {
|
||||
HashMap<String, Object> subMap = getElementValue(elementName, eventReader, event);
|
||||
addValue(retMap, elementName, subMap);
|
||||
depth--;
|
||||
elementName = null;
|
||||
}
|
||||
|
||||
// 1 레벨 엘리먼트 종료된 경우, 돌아가기
|
||||
if(depth == 1 && elementName == null && event.isEndElement() && rootElementName.equals(event.asEndElement().getName().getLocalPart())) {
|
||||
depth--;
|
||||
return retMap;
|
||||
}
|
||||
|
||||
} // while
|
||||
|
||||
} catch (XMLStreamException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.out.println("END");
|
||||
return retMap;
|
||||
}
|
||||
|
||||
public static void addValue(HashMap<String, Object> map, String key, Object value) throws Exception {
|
||||
if(map == null) throw new Exception("값을 넣을 Map 변수가 초기화되지 않았습니다.");
|
||||
|
||||
if(key == null) return;
|
||||
if(value == null) return;
|
||||
|
||||
Object curValObj = map.get(key);
|
||||
if(curValObj == null) {
|
||||
map.put(key, value);
|
||||
return;
|
||||
}
|
||||
|
||||
if(curValObj instanceof String || curValObj instanceof HashMap) {
|
||||
List<Object> values = new ArrayList<Object>();
|
||||
values.add(curValObj);
|
||||
values.add(value);
|
||||
map.put(key, values);
|
||||
} else if(curValObj instanceof List) {
|
||||
((ArrayList<Object>)curValObj).add(value);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
public static void main(String argv[]) throws Exception {
|
||||
|
||||
XmlConverter xmlConverter = new XmlConverter();
|
||||
String xmlStr = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n" +
|
||||
"<!-- uac.service.board.qna_GET.xml -->\r\n" +
|
||||
"<result>\r\n" +
|
||||
" <code>S</code>\r\n" +
|
||||
" <message>성공적으로 조회되었습니다.</message>\r\n" +
|
||||
" <records>10</records>\r\n" +
|
||||
" <page>1</page>\r\n" +
|
||||
" <totPages>15</totPages>\r\n" +
|
||||
" <record>\r\n" +
|
||||
" <noticeNo>1</noticeNo>\r\n" +
|
||||
" <noticeType>101</noticeType>\r\n" +
|
||||
" <title>공지사항 테스트</title>\r\n" +
|
||||
" <readCount>15</readCount>\r\n" +
|
||||
" <regDate>2021-07-19</regDate>\r\n" +
|
||||
" </record>\r\n" +
|
||||
" <record>\r\n" +
|
||||
" <noticeNo>2</noticeNo>\r\n" +
|
||||
" <noticeType>101</noticeType>\r\n" +
|
||||
" <title>공지사항 테스트</title>\r\n" +
|
||||
" <readCount>55</readCount>\r\n" +
|
||||
" <regDate>2021-07-19</regDate>\r\n" +
|
||||
" </record>\r\n" +
|
||||
" <record>\r\n" +
|
||||
" <noticeNo>3</noticeNo>\r\n" +
|
||||
" <noticeType>101</noticeType>\r\n" +
|
||||
" <title>공지사항 테스트</title>\r\n" +
|
||||
" <readCount>55</readCount>\r\n" +
|
||||
" <regDate>2021-07-19</regDate>\r\n" +
|
||||
" </record>\r\n" +
|
||||
" <record>\r\n" +
|
||||
" <noticeNo>4</noticeNo>\r\n" +
|
||||
" <noticeType>101</noticeType>\r\n" +
|
||||
" <title>공지사항 테스트</title>\r\n" +
|
||||
" <readCount>55</readCount>\r\n" +
|
||||
" <regDate>2021-07-19</regDate>\r\n" +
|
||||
" </record>\r\n" +
|
||||
" <record>\r\n" +
|
||||
" <noticeNo>5</noticeNo>\r\n" +
|
||||
" <noticeType>101</noticeType>\r\n" +
|
||||
" <title>공지사항 테스트</title>\r\n" +
|
||||
" <readCount>55</readCount>\r\n" +
|
||||
" <regDate>2021-07-19</regDate>\r\n" +
|
||||
" </record>\r\n" +
|
||||
" <record>\r\n" +
|
||||
" <noticeNo>6</noticeNo>\r\n" +
|
||||
" <noticeType>101</noticeType>\r\n" +
|
||||
" <title>공지사항 테스트</title>\r\n" +
|
||||
" <readCount>55</readCount>\r\n" +
|
||||
" <regDate>2021-07-19</regDate>\r\n" +
|
||||
" </record>\r\n" +
|
||||
" <end>3333</end>\r\n" +
|
||||
"</result>";
|
||||
|
||||
HashMap<String, Object> resMap = xmlConverter.convert(xmlStr);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@ -1,48 +1,48 @@
|
||||
package nlib.util;
|
||||
|
||||
import egovframework.com.utl.fcc.service.EgovFormBasedFileUtil;
|
||||
import egovframework.com.utl.fcc.service.EgovFormBasedUUID;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* @Class Name : UUID.java
|
||||
*
|
||||
* @Description : UUID를 생성한다.
|
||||
*
|
||||
*
|
||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 2021. 7. 13. KNKIM 최초 생성
|
||||
*
|
||||
*
|
||||
* @author 이씨플라자 * DIGITALSHIP KNKIM
|
||||
* @since 2021. 7. 13.
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class UUID {
|
||||
|
||||
/**
|
||||
* 새로운 UUID를 생성하여 리턴한다.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getNewUUID() {
|
||||
return EgovFormBasedUUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일용 UUID로 생성한 파일명을 리턴한다.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getPhysicalFileName() {
|
||||
return "F" + StringUtil.getTimeStamp() + "_" + getNewUUID().replaceAll("-", "").toUpperCase();
|
||||
}
|
||||
|
||||
}
|
||||
package nlib.util;
|
||||
|
||||
import egovframework.com.utl.fcc.service.EgovFormBasedFileUtil;
|
||||
import egovframework.com.utl.fcc.service.EgovFormBasedUUID;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* @Class Name : UUID.java
|
||||
*
|
||||
* @Description : UUID를 생성한다.
|
||||
*
|
||||
*
|
||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 2021. 7. 13. KNKIM 최초 생성
|
||||
*
|
||||
*
|
||||
* @author 이씨플라자 * DIGITALSHIP KNKIM
|
||||
* @since 2021. 7. 13.
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class UUID {
|
||||
|
||||
/**
|
||||
* 새로운 UUID를 생성하여 리턴한다.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getNewUUID() {
|
||||
return EgovFormBasedUUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일용 UUID로 생성한 파일명을 리턴한다.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getPhysicalFileName() {
|
||||
return "F" + StringUtil.getTimeStamp() + "_" + getNewUUID().replaceAll("-", "").toUpperCase();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
143
src/main/webapp/WEB-INF/jsp/nlib/board/updateQnAForm.jsp
Normal file
143
src/main/webapp/WEB-INF/jsp/nlib/board/updateQnAForm.jsp
Normal file
@ -0,0 +1,143 @@
|
||||
<%
|
||||
/**
|
||||
* <pre>
|
||||
* @Class Name : updateQnAForm.jsp
|
||||
*
|
||||
* @Description : 묻고답하기 수정화면을 표출한다.
|
||||
*
|
||||
*
|
||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 2021. 7. 23. KNKIM 최초 생성
|
||||
*
|
||||
*
|
||||
* @author 이씨플라자 * DIGITALSHIP KNKIM
|
||||
* @since 2021. 7. 23.
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||||
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
|
||||
|
||||
<c:set var="pageTitle">묻고답하기 - 수정</c:set>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>${pageTitle}</title>
|
||||
|
||||
<!-- GRID -->
|
||||
<link type="text/css" rel="stylesheet" href="/nlib/js/jsgrid/nlib-jsgrid.css" />
|
||||
<link type="text/css" rel="stylesheet" href="/nlib/js/jsgrid/nlib-jsgrid-theme.css" />
|
||||
<script src="/nlib/js/jsgrid/nlib-jsgrid.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>${pageTitle }</h1>
|
||||
|
||||
<span style="color:red;">${message }</span>
|
||||
<br />
|
||||
|
||||
<form name="articleForm" id="articleForm"
|
||||
action="${pageContext.request.contextPath}/board/listQnAs.do"
|
||||
method="post">
|
||||
|
||||
|
||||
<input type="text" name="pageNo" id="pageNo" title="페이지번호" value="${pageNo}" size="5" maxlength="5" readonly />
|
||||
<input type="text" name="pageRows" id="pageRows" title="목록에 보여줄 글 개" value="${pageRows}" size="5" maxlength="5" readonly />
|
||||
<input type="text" name="searchKeyword" id="searchKeyword" title="검색어" value="${searchKeyword}" size="35" maxlength="50" readonly />
|
||||
<input type="text" name="articleNo" id="articleNo" value="${articleNo}" title="선택글번호" readonly />
|
||||
<input type="text" name="articlePassword" id="articlePassword" value="${articlePassword}" title="글비밀번호" readonly />
|
||||
|
||||
<table class="table_content" style="width:100% !important;">
|
||||
<tr>
|
||||
<td>제목</td>
|
||||
<td><input type="text" name="title" id="title" title="제목" value="${article.title}" size="100" maxlength="200" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>작성자</td>
|
||||
<td><input type="text" name="regUserName" id="regUserName" title="제목" value="${article.regUserName}" size="100" maxlength="200" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>이메일</td>
|
||||
<td><input type="text" name="email" id="email" title="이메일" value="${article.email}" size="100" maxlength="200" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>기존비밀번호</td>
|
||||
<td><input type="text" name="encArticlePassword" id="encArticlePassword" title="제목" value="${encArticlePassword}" size="100" maxlength="200" readonly /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>비밀번호</td>
|
||||
<td><input type="text" name="articlePassword" id="articlePassword" title="비밀번호" value="${article.articlePassword}" size="100" maxlength="200" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>질문내용</td>
|
||||
<td><textarea name="contentQeust" id="contentQeust">${article.contentQeust}</textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
||||
<button type="button" name="btnNew" id="btnNew" class="float"
|
||||
onclick="fn_view_detail('${articleNo}')">취소</button>
|
||||
<button type="button" name="btnNew" id="btnNew" class="float"
|
||||
onclick="fn_update()">저장</button>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<script type="text/javaScript" language="javascript">
|
||||
|
||||
//선택한 게시글 상세 보기로 이동
|
||||
function fn_view_detail(articleNo) {
|
||||
$("#articleNo").val(articleNo);
|
||||
$("#articleForm").attr("action", "${pageContext.request.contextPath}/board/selectQnA.do");
|
||||
$("#articleForm").submit();
|
||||
}
|
||||
|
||||
// 선택한 게시글 상세 보기로 이동
|
||||
function fn_list() {
|
||||
$("#articleForm").attr("action", "${pageContext.request.contextPath}/board/listQnAs.do");
|
||||
$("#articleForm").submit();
|
||||
}
|
||||
|
||||
|
||||
var fn_updateForm = function (passwd) {
|
||||
if(passwd == null || passwd == "") {
|
||||
alert("수정을 위한 게시물의 비밀번호를 입력하여 주시기 바랍니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
$("#articlePassword").val(passwd);
|
||||
$("#articleForm").attr("action", "${pageContext.request.contextPath}/board/updateQnAForm.do");
|
||||
$("#articleForm").submit();
|
||||
}
|
||||
|
||||
// 수정 처리
|
||||
function fn_update() {
|
||||
if(!confirm("저장하시겠습니까?")) return;
|
||||
|
||||
$("#articleForm").attr("action", "${pageContext.request.contextPath}/board/updateQnA.do");
|
||||
$("#articleForm").submit();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,4 +1,4 @@
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ page language="java" contentType="application/javascript" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ page language="java" contentType="application/javascript" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
|
||||
<validator:javascript dynamicJavascript="false" staticJavascript="true"/>
|
||||
@ -1,88 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
id="WebApp_ID" version="2.5">
|
||||
<display-name>nlib</display-name>
|
||||
|
||||
<filter>
|
||||
<filter-name>encodingFilter</filter-name>
|
||||
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>encoding</param-name>
|
||||
<param-value>utf-8</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>encodingFilter</filter-name>
|
||||
<url-pattern>*.do</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<filter>
|
||||
<filter-name>HTMLTagFilter</filter-name>
|
||||
<filter-class>egovframework.rte.ptl.mvc.filter.HTMLTagFilter</filter-class>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>HTMLTagFilter</filter-name>
|
||||
<url-pattern>*.do</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!-- Spring Security Filter : DIGITALSHIP 2021.07.02 -->
|
||||
<filter>
|
||||
<filter-name>springSecurityFilterChain</filter-name>
|
||||
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>springSecurityFilterChain</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>classpath*:egovframework/spring/context-*.xml</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>action</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>/WEB-INF/config/egovframework/springmvc/dispatcher-servlet.xml</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>action</servlet-name>
|
||||
<url-pattern>*.do</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>action</servlet-name>
|
||||
<url-pattern>*.ajax</url-pattern>
|
||||
</servlet-mapping>
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.jsp</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
<login-config>
|
||||
<auth-method>BASIC</auth-method>
|
||||
</login-config>
|
||||
|
||||
<error-page>
|
||||
<exception-type>java.lang.Throwable</exception-type>
|
||||
<location>/common/error.jsp</location>
|
||||
</error-page>
|
||||
<error-page>
|
||||
<error-code>404</error-code>
|
||||
<location>/common/error.jsp</location>
|
||||
</error-page>
|
||||
<error-page>
|
||||
<error-code>500</error-code>
|
||||
<location>/common/error.jsp</location>
|
||||
</error-page>
|
||||
|
||||
</web-app>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
id="WebApp_ID" version="2.5">
|
||||
<display-name>nlib</display-name>
|
||||
|
||||
<filter>
|
||||
<filter-name>encodingFilter</filter-name>
|
||||
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>encoding</param-name>
|
||||
<param-value>utf-8</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>encodingFilter</filter-name>
|
||||
<url-pattern>*.do</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<filter>
|
||||
<filter-name>HTMLTagFilter</filter-name>
|
||||
<filter-class>egovframework.rte.ptl.mvc.filter.HTMLTagFilter</filter-class>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>HTMLTagFilter</filter-name>
|
||||
<url-pattern>*.do</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!-- Spring Security Filter : DIGITALSHIP 2021.07.02 -->
|
||||
<filter>
|
||||
<filter-name>springSecurityFilterChain</filter-name>
|
||||
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>springSecurityFilterChain</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>classpath*:egovframework/spring/context-*.xml</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>action</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>/WEB-INF/config/egovframework/springmvc/dispatcher-servlet.xml</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>action</servlet-name>
|
||||
<url-pattern>*.do</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>action</servlet-name>
|
||||
<url-pattern>*.ajax</url-pattern>
|
||||
</servlet-mapping>
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.jsp</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
<login-config>
|
||||
<auth-method>BASIC</auth-method>
|
||||
</login-config>
|
||||
|
||||
<error-page>
|
||||
<exception-type>java.lang.Throwable</exception-type>
|
||||
<location>/common/error.jsp</location>
|
||||
</error-page>
|
||||
<error-page>
|
||||
<error-code>404</error-code>
|
||||
<location>/common/error.jsp</location>
|
||||
</error-page>
|
||||
<error-page>
|
||||
<error-code>500</error-code>
|
||||
<location>/common/error.jsp</location>
|
||||
</error-page>
|
||||
|
||||
</web-app>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user