Skip to content

Commit

Permalink
修改页面找不到bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rayoy committed May 22, 2016
1 parent fa55fd5 commit abcad73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.test.annotation.Rollback;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.DigestUtils;

Expand Down Expand Up @@ -69,13 +70,13 @@ public Exposer exportSeckillUrl(long seckillId) {
}


@Transactional
/**
* 使用注解控制事务的优点:
* 1.开发团队达成一致约定,明确标注事务方法的编程风格.
* 2.保证事务方法的执行时间尽可能短,不要穿插其他网络操作RPC/HTTP请求或者玻璃到事务方法外部.
* 3.不是所有的方法都需要事务.如一些查询的service.只有一条修改操作的service.
*/
@Transactional
public SeckillExecution executeSeckill(long seckillId, long userPhone, String md5) throws SeckillException, RepeatKillException, SeckillCloseException {
if (StringUtils.isEmpty(md5) || !md5.equals(getMD5(seckillId))) {
throw new SeckillException("seckill data rewrite");
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/spring/spring-web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<!--3:配置JSP 显示ViewResolver-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp"/>
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
<!--4:扫描web相关的bean-->
Expand Down

0 comments on commit abcad73

Please sign in to comment.