Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring setting #1

Open
WonYong-Jang opened this issue Aug 28, 2019 · 1 comment
Open

Spring setting #1

WonYong-Jang opened this issue Aug 28, 2019 · 1 comment

Comments

@WonYong-Jang
Copy link
Owner

WonYong-Jang commented Aug 28, 2019

Character breakup occurs

  • If character breakup occurs after creating Spring project, write in web.xml of project files
<!-- Character Set Filter -->
<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>
	<init-param>
		<param-name>forceEncoding</param-name>
		<param-value>true</param-value>
	</init-param>
</filter>
<filter-mapping>
	<filter-name>encodingFilter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>

the web system first consults web.xml to locate the files associated with the spring configuration and to reference those filse.

  • 'classpath' is /src/main/resources/
  • web.xml consist in path of root-context.xml and servlet-context.xml
  • create a directory called spring in the path of src/main/resources/ ( to collect files scattered in one place. )
  • modify path of two files(root-context, servlet-context) in web.xml
 <context-param>
       <param-name>contextConfigLocation</param-name>
       <param-value>classpath:spring/*-context.xml</param-value> 
</context-param>

<servlet>
	<servlet-name>appServlet</servlet-name>
	<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
	<init-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>classpath:servlet-context.xml</param-value>
	</init-param>
	<load-on-startup>1</load-on-startup>
</servlet>

Controller URL

스크린샷 2019-09-02 오후 10 15 26

  • Return "board/index" in getBoardList function can be found in servlet-conext.xml
    ==> ViewResolver
    ==> prefix and suffix
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
	<beans:property name="prefix" value="/WEB-INF/views/" />
	<beans:property name="suffix" value=".jsp" />
</beans:bean>

link : https://freehoon.tistory.com/101

@WonYong-Jang
Copy link
Owner Author

WonYong-Jang commented Aug 31, 2019

database setting

$ mysql -uroot -p
mysql> show databases
mysql > show create table [table명] // show create script

mysql> show warnings\g // show error log

스크린샷 2019-08-29 오후 10 15 58

스크린샷 2019-08-29 오후 10 16 04

참고 링크 : https://all-record.tistory.com/96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant